@agimon-ai/po-native-components 0.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +71 -0
  3. package/dist/components/Badge.d.mts +17 -0
  4. package/dist/components/Badge.d.mts.map +1 -0
  5. package/dist/components/Badge.mjs +106 -0
  6. package/dist/components/Badge.mjs.map +1 -0
  7. package/dist/components/Button.d.mts +20 -0
  8. package/dist/components/Button.d.mts.map +1 -0
  9. package/dist/components/Button.mjs +278 -0
  10. package/dist/components/Button.mjs.map +1 -0
  11. package/dist/components/CodeBlock.d.mts +10 -0
  12. package/dist/components/CodeBlock.d.mts.map +1 -0
  13. package/dist/components/CodeBlock.mjs +88 -0
  14. package/dist/components/CodeBlock.mjs.map +1 -0
  15. package/dist/components/Dialog.d.mts +52 -0
  16. package/dist/components/Dialog.d.mts.map +1 -0
  17. package/dist/components/Dialog.mjs +257 -0
  18. package/dist/components/Dialog.mjs.map +1 -0
  19. package/dist/components/Dot.d.mts +17 -0
  20. package/dist/components/Dot.d.mts.map +1 -0
  21. package/dist/components/Dot.mjs +94 -0
  22. package/dist/components/Dot.mjs.map +1 -0
  23. package/dist/components/DropdownMenu.d.mts +63 -0
  24. package/dist/components/DropdownMenu.d.mts.map +1 -0
  25. package/dist/components/DropdownMenu.mjs +256 -0
  26. package/dist/components/DropdownMenu.mjs.map +1 -0
  27. package/dist/components/EmptyState.d.mts +14 -0
  28. package/dist/components/EmptyState.d.mts.map +1 -0
  29. package/dist/components/EmptyState.mjs +64 -0
  30. package/dist/components/EmptyState.mjs.map +1 -0
  31. package/dist/components/Input.d.mts +19 -0
  32. package/dist/components/Input.d.mts.map +1 -0
  33. package/dist/components/Input.mjs +123 -0
  34. package/dist/components/Input.mjs.map +1 -0
  35. package/dist/components/Label.d.mts +13 -0
  36. package/dist/components/Label.d.mts.map +1 -0
  37. package/dist/components/Label.mjs +36 -0
  38. package/dist/components/Label.mjs.map +1 -0
  39. package/dist/components/List.d.mts +48 -0
  40. package/dist/components/List.d.mts.map +1 -0
  41. package/dist/components/List.mjs +156 -0
  42. package/dist/components/List.mjs.map +1 -0
  43. package/dist/components/Markdown.d.mts +15 -0
  44. package/dist/components/Markdown.d.mts.map +1 -0
  45. package/dist/components/Markdown.mjs +219 -0
  46. package/dist/components/Markdown.mjs.map +1 -0
  47. package/dist/components/MessageItem.d.mts +87 -0
  48. package/dist/components/MessageItem.d.mts.map +1 -0
  49. package/dist/components/MessageItem.mjs +361 -0
  50. package/dist/components/MessageItem.mjs.map +1 -0
  51. package/dist/components/Panel.d.mts +15 -0
  52. package/dist/components/Panel.d.mts.map +1 -0
  53. package/dist/components/Panel.mjs +77 -0
  54. package/dist/components/Panel.mjs.map +1 -0
  55. package/dist/components/PoNativeProvider.d.mts +15 -0
  56. package/dist/components/PoNativeProvider.d.mts.map +1 -0
  57. package/dist/components/PoNativeProvider.mjs +22 -0
  58. package/dist/components/PoNativeProvider.mjs.map +1 -0
  59. package/dist/components/SectionLabel.d.mts +6 -0
  60. package/dist/components/SectionLabel.d.mts.map +1 -0
  61. package/dist/components/SectionLabel.mjs +40 -0
  62. package/dist/components/SectionLabel.mjs.map +1 -0
  63. package/dist/components/SegmentedControl.d.mts +26 -0
  64. package/dist/components/SegmentedControl.d.mts.map +1 -0
  65. package/dist/components/SegmentedControl.mjs +56 -0
  66. package/dist/components/SegmentedControl.mjs.map +1 -0
  67. package/dist/components/Sheet.d.mts +39 -0
  68. package/dist/components/Sheet.d.mts.map +1 -0
  69. package/dist/components/Sheet.mjs +166 -0
  70. package/dist/components/Sheet.mjs.map +1 -0
  71. package/dist/components/SheetFrame.mjs +84 -0
  72. package/dist/components/SheetFrame.mjs.map +1 -0
  73. package/dist/components/Spinner.d.mts +19 -0
  74. package/dist/components/Spinner.d.mts.map +1 -0
  75. package/dist/components/Spinner.mjs +34 -0
  76. package/dist/components/Spinner.mjs.map +1 -0
  77. package/dist/components/StatusBadge.d.mts +23 -0
  78. package/dist/components/StatusBadge.d.mts.map +1 -0
  79. package/dist/components/StatusBadge.mjs +116 -0
  80. package/dist/components/StatusBadge.mjs.map +1 -0
  81. package/dist/components/Tabs.d.mts +44 -0
  82. package/dist/components/Tabs.d.mts.map +1 -0
  83. package/dist/components/Tabs.mjs +197 -0
  84. package/dist/components/Tabs.mjs.map +1 -0
  85. package/dist/components/Textarea.d.mts +10 -0
  86. package/dist/components/Textarea.d.mts.map +1 -0
  87. package/dist/components/Textarea.mjs +29 -0
  88. package/dist/components/Textarea.mjs.map +1 -0
  89. package/dist/icons/IconColorContext.d.mts +10 -0
  90. package/dist/icons/IconColorContext.d.mts.map +1 -0
  91. package/dist/icons/IconColorContext.mjs +13 -0
  92. package/dist/icons/IconColorContext.mjs.map +1 -0
  93. package/dist/icons/iconGlyphs.d.mts +120 -0
  94. package/dist/icons/iconGlyphs.d.mts.map +1 -0
  95. package/dist/icons/iconGlyphs.mjs +121 -0
  96. package/dist/icons/iconGlyphs.mjs.map +1 -0
  97. package/dist/icons/icons.d.mts +122 -0
  98. package/dist/icons/icons.d.mts.map +1 -0
  99. package/dist/icons/icons.mjs +79 -0
  100. package/dist/icons/icons.mjs.map +1 -0
  101. package/dist/index.d.mts +27 -0
  102. package/dist/index.mjs +27 -0
  103. package/dist/lib/fonts.d.mts +13 -0
  104. package/dist/lib/fonts.d.mts.map +1 -0
  105. package/dist/lib/fonts.mjs +22 -0
  106. package/dist/lib/fonts.mjs.map +1 -0
  107. package/dist/lib/haptics.d.mts +7 -0
  108. package/dist/lib/haptics.d.mts.map +1 -0
  109. package/dist/lib/haptics.mjs +25 -0
  110. package/dist/lib/haptics.mjs.map +1 -0
  111. package/dist/lib/insideSheet.mjs +16 -0
  112. package/dist/lib/insideSheet.mjs.map +1 -0
  113. package/dist/lib/markdown.mjs +271 -0
  114. package/dist/lib/markdown.mjs.map +1 -0
  115. package/dist/lib/tone.mjs +50 -0
  116. package/dist/lib/tone.mjs.map +1 -0
  117. package/dist/lib/useControllable.mjs +22 -0
  118. package/dist/lib/useControllable.mjs.map +1 -0
  119. package/dist/lib/wrapText.mjs +20 -0
  120. package/dist/lib/wrapText.mjs.map +1 -0
  121. package/llms.txt +8 -0
  122. package/package.json +104 -0
@@ -0,0 +1,361 @@
1
+ import { fontOf } from "../lib/fonts.mjs";
2
+ import { STATUS_COLORS } from "../lib/tone.mjs";
3
+ import { wrapText } from "../lib/wrapText.mjs";
4
+ import { Spinner } from "./Spinner.mjs";
5
+ import { Button } from "./Button.mjs";
6
+ import { AlertIcon, CheckIcon, ChevronDownIcon, ChevronRightIcon, WrenchIcon } from "../icons/icons.mjs";
7
+ import { useControllable } from "../lib/useControllable.mjs";
8
+ import { STATUS_EDGE, StatusBadge } from "./StatusBadge.mjs";
9
+ import { View } from "react-native-unistyles/components/native/View";
10
+ import { StyleSheet } from "react-native-unistyles";
11
+ import { Text } from "react-native-unistyles/components/native/Text";
12
+ import { createContext, useContext } from "react";
13
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
14
+ import { Pressable } from "react-native-unistyles/components/native/Pressable";
15
+
16
+ //#region src/components/MessageItem.tsx
17
+ const MIN_ROW_HEIGHT = 44;
18
+ const LEAD_CHIP = 36;
19
+ const ROW_EDGE_WIDTH = 2;
20
+ const MessageItemContext = createContext({
21
+ tone: "neutral",
22
+ expandable: false,
23
+ expanded: false,
24
+ toggle: () => void 0
25
+ });
26
+ /** The enclosing item's state, for a part that lives deeper than the item's render prop. */
27
+ function useMessageItem() {
28
+ return useContext(MessageItemContext);
29
+ }
30
+ /** The group an item is a row of, or null for an item that is a card of its own. */
31
+ const MessageItemGroupContext = createContext(null);
32
+ /** The tone a tool call's item wears: running while the tool runs, then its outcome. */
33
+ function toolTone(state) {
34
+ return state.running ? "running" : state.isError ? "error" : "ok";
35
+ }
36
+ /** The badge text a tone reads as when the header is not told otherwise; empty hides the badge. */
37
+ const STATUS_LABEL = {
38
+ neutral: "",
39
+ running: "Running",
40
+ ok: "Completed",
41
+ error: "Failed",
42
+ info: "Info",
43
+ accent: "Note"
44
+ };
45
+ /** The glyph a tone reads as in a status line. */
46
+ const STATUS_GLYPH = {
47
+ neutral: "…",
48
+ running: "◐",
49
+ ok: "✓",
50
+ error: "✗",
51
+ info: "●",
52
+ accent: "●"
53
+ };
54
+ /** A settled OK is the calm default and keeps the soft border; only work in flight or a failure colours the edge. */
55
+ function cardEdge(tone) {
56
+ return tone === "ok" ? "border-soft" : STATUS_EDGE[tone];
57
+ }
58
+ /** As a row, a settled or neutral item keeps a quiet edge. */
59
+ function rowEdge(tone) {
60
+ return tone === "ok" || tone === "neutral" ? void 0 : STATUS_EDGE[tone];
61
+ }
62
+ function MessageItem({ tone = "neutral", expandable = false, defaultExpanded = false, expanded, onExpandedChange, children, style, ...props }) {
63
+ const [current, setExpanded] = useControllable(expanded, defaultExpanded, onExpandedChange);
64
+ const group = useContext(MessageItemGroupContext);
65
+ const state = {
66
+ tone,
67
+ expandable,
68
+ expanded: current,
69
+ toggle: () => setExpanded(!current)
70
+ };
71
+ return /* @__PURE__ */ jsx(MessageItemContext.Provider, {
72
+ value: state,
73
+ children: /* @__PURE__ */ jsx(View, {
74
+ style: [group === null ? styles.cardEdge(cardEdge(tone)) : styles.rowEdge(rowEdge(tone)), style],
75
+ ...props,
76
+ children: typeof children === "function" ? children(state) : children
77
+ })
78
+ });
79
+ }
80
+ /** The line beside the title; a bare string stays on one line and truncates, as the web's `truncate`. */
81
+ function Summary({ children }) {
82
+ return /* @__PURE__ */ jsx(View, {
83
+ style: styles.summary,
84
+ children: typeof children === "string" ? /* @__PURE__ */ jsx(Text, {
85
+ numberOfLines: 1,
86
+ style: styles.summaryText,
87
+ children
88
+ }) : wrapText(children, styles.summaryText)
89
+ });
90
+ }
91
+ /** The card's lead: the tool chip, the "Tool call" caption, then the name and its summary on one line. */
92
+ function ToolCallLead({ title, children }) {
93
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(View, {
94
+ accessible: false,
95
+ style: styles.chip,
96
+ children: /* @__PURE__ */ jsx(WrenchIcon, { size: 16 })
97
+ }), /* @__PURE__ */ jsxs(View, {
98
+ style: styles.lead,
99
+ children: [/* @__PURE__ */ jsx(Text, {
100
+ style: styles.caption,
101
+ children: "Tool call"
102
+ }), /* @__PURE__ */ jsxs(View, {
103
+ style: styles.titleLine,
104
+ children: [wrapText(title, styles.title), /* @__PURE__ */ jsx(Summary, { children })]
105
+ })]
106
+ })] });
107
+ }
108
+ /** The sentence-case outcome pill, led by the tone's icon. */
109
+ function OutcomeBadge({ tone, children }) {
110
+ const ink = STATUS_COLORS[tone].ink;
111
+ return /* @__PURE__ */ jsxs(StatusBadge, {
112
+ tone,
113
+ size: "md",
114
+ style: styles.outcome,
115
+ children: [
116
+ tone === "running" ? /* @__PURE__ */ jsx(Spinner, { color: ink }) : null,
117
+ tone === "ok" ? /* @__PURE__ */ jsx(CheckIcon, {
118
+ size: 12,
119
+ color: ink
120
+ }) : null,
121
+ tone === "error" ? /* @__PURE__ */ jsx(AlertIcon, {
122
+ size: 12,
123
+ color: ink
124
+ }) : null,
125
+ children
126
+ ]
127
+ });
128
+ }
129
+ /**
130
+ * One frame around a run of items that belong together. Each item inside
131
+ * becomes a row: same header, same expand, no card of its own, and its tone
132
+ * an edge down its left side.
133
+ */
134
+ function MessageItemGroup({ tone = "neutral", title, summary, badge, children, style, ...props }) {
135
+ const label = badge === void 0 ? STATUS_LABEL[tone] : badge;
136
+ return /* @__PURE__ */ jsx(MessageItemGroupContext.Provider, {
137
+ value: { tone },
138
+ children: /* @__PURE__ */ jsxs(View, {
139
+ style: [styles.cardEdge(cardEdge(tone)), style],
140
+ ...props,
141
+ children: [/* @__PURE__ */ jsxs(View, {
142
+ accessibilityRole: "header",
143
+ style: styles.header,
144
+ children: [/* @__PURE__ */ jsx(ToolCallLead, {
145
+ title,
146
+ children: typeof summary === "string" ? /* @__PURE__ */ jsx(Text, {
147
+ numberOfLines: 1,
148
+ style: styles.faint,
149
+ children: summary
150
+ }) : summary
151
+ }), label !== null && label !== "" ? /* @__PURE__ */ jsx(OutcomeBadge, {
152
+ tone,
153
+ children: label
154
+ }) : null]
155
+ }), /* @__PURE__ */ jsx(View, { children })]
156
+ })
157
+ });
158
+ }
159
+ /** Inside a group these two are the quiet outcome: the group's header has already said it. */
160
+ const SILENT_IN_GROUP = /* @__PURE__ */ new Set(["ok", "neutral"]);
161
+ /**
162
+ * The title row: label, summary, the tone's badge and, when the item is
163
+ * expandable, a chevron; the whole row is the toggle. A row inside a group
164
+ * drops its title and speaks up only when something failed or is running.
165
+ */
166
+ function MessageItemHeader({ title, badge, children, style, ...props }) {
167
+ const { tone, expandable, expanded, toggle } = useMessageItem();
168
+ const group = useContext(MessageItemGroupContext);
169
+ const defaultLabel = group !== null && SILENT_IN_GROUP.has(tone) ? null : STATUS_LABEL[tone];
170
+ const label = badge === void 0 ? defaultLabel : badge;
171
+ const content = /* @__PURE__ */ jsxs(Fragment, { children: [
172
+ group === null ? /* @__PURE__ */ jsx(ToolCallLead, {
173
+ title,
174
+ children
175
+ }) : /* @__PURE__ */ jsx(Summary, { children }),
176
+ label !== null && label !== "" ? /* @__PURE__ */ jsx(OutcomeBadge, {
177
+ tone,
178
+ children: label
179
+ }) : null,
180
+ expandable ? expanded ? /* @__PURE__ */ jsx(ChevronDownIcon, { size: 16 }) : /* @__PURE__ */ jsx(ChevronRightIcon, { size: 16 }) : null
181
+ ] });
182
+ if (!expandable) return /* @__PURE__ */ jsx(View, {
183
+ style: [styles.header, style],
184
+ ...props,
185
+ children: content
186
+ });
187
+ return /* @__PURE__ */ jsx(Pressable, {
188
+ accessibilityRole: "button",
189
+ accessibilityState: { expanded },
190
+ accessibilityHint: expanded ? "collapse" : "expand",
191
+ onPress: toggle,
192
+ style: ({ pressed }) => [
193
+ styles.header,
194
+ pressed && styles.headerPressed,
195
+ style
196
+ ],
197
+ ...props,
198
+ children: content
199
+ });
200
+ }
201
+ /** The body under the header, on the card's own surface. */
202
+ function MessageItemBody({ children, style, ...props }) {
203
+ return /* @__PURE__ */ jsx(View, {
204
+ style: [styles.body, style],
205
+ ...props,
206
+ children: wrapText(children, styles.bodyText)
207
+ });
208
+ }
209
+ /** The one-line status under a body: `running`, `failed`, `done`, or the hint that more is hidden. */
210
+ function MessageItemStatus({ tone = "neutral", glyph, expands = false, children, containerStyle, style, ...props }) {
211
+ const { toggle } = useMessageItem();
212
+ const line = /* @__PURE__ */ jsxs(Text, {
213
+ style: [styles.status, style],
214
+ ...props,
215
+ children: [
216
+ /* @__PURE__ */ jsx(Text, {
217
+ style: styles.glyph(tone),
218
+ children: glyph ?? STATUS_GLYPH[tone]
219
+ }),
220
+ " ",
221
+ children
222
+ ]
223
+ });
224
+ if (expands) return /* @__PURE__ */ jsx(Button, {
225
+ variant: "ghost",
226
+ size: "xs",
227
+ onPress: toggle,
228
+ style: [styles.more, containerStyle],
229
+ children: line
230
+ });
231
+ return /* @__PURE__ */ jsx(View, {
232
+ style: containerStyle,
233
+ children: line
234
+ });
235
+ }
236
+ const styles = StyleSheet.create((theme) => ({
237
+ cardEdge: (token) => ({
238
+ overflow: "hidden",
239
+ borderRadius: theme.borderRadius.lg,
240
+ borderWidth: 1,
241
+ borderColor: theme.colors[token],
242
+ uni__dependencies: [0]
243
+ }),
244
+ rowEdge: (token) => ({
245
+ overflow: "hidden",
246
+ borderTopWidth: 1,
247
+ borderTopColor: theme.colors["border-soft"],
248
+ borderLeftWidth: ROW_EDGE_WIDTH,
249
+ borderLeftColor: token === void 0 ? "transparent" : theme.colors[token],
250
+ uni__dependencies: [0]
251
+ }),
252
+ header: {
253
+ flexDirection: "row",
254
+ alignItems: "center",
255
+ gap: theme.spacing(3),
256
+ minHeight: MIN_ROW_HEIGHT,
257
+ paddingHorizontal: theme.spacing(4),
258
+ paddingVertical: theme.spacing(3),
259
+ uni__dependencies: [0]
260
+ },
261
+ headerPressed: {
262
+ backgroundColor: theme.colors.panel,
263
+ uni__dependencies: [0]
264
+ },
265
+ chip: {
266
+ alignItems: "center",
267
+ justifyContent: "center",
268
+ width: LEAD_CHIP,
269
+ height: LEAD_CHIP,
270
+ flexShrink: 0,
271
+ borderRadius: theme.borderRadius.full,
272
+ backgroundColor: theme.colors.rail,
273
+ uni__dependencies: [0]
274
+ },
275
+ lead: {
276
+ flex: 1,
277
+ minWidth: 0
278
+ },
279
+ caption: {
280
+ color: theme.colors.dim,
281
+ fontFamily: fontOf(theme.fontFamily.sans),
282
+ fontSize: theme.fontSize.sm,
283
+ lineHeight: theme.lineHeight.sm,
284
+ uni__dependencies: [0]
285
+ },
286
+ titleLine: {
287
+ flexDirection: "row",
288
+ alignItems: "center",
289
+ gap: theme.spacing(2),
290
+ minWidth: 0,
291
+ uni__dependencies: [0]
292
+ },
293
+ title: {
294
+ flexShrink: 0,
295
+ color: theme.colors.hi,
296
+ fontFamily: fontOf(theme.fontFamily.sans),
297
+ fontSize: theme.fontSize.base,
298
+ lineHeight: theme.lineHeight.base,
299
+ fontWeight: theme.fontWeight.semibold,
300
+ uni__dependencies: [0]
301
+ },
302
+ summary: {
303
+ flex: 1,
304
+ flexDirection: "row",
305
+ alignItems: "center",
306
+ gap: theme.spacing(2),
307
+ minWidth: 0,
308
+ uni__dependencies: [0]
309
+ },
310
+ summaryText: {
311
+ flexShrink: 1,
312
+ color: theme.colors.faint,
313
+ fontFamily: fontOf(theme.fontFamily.sans),
314
+ fontSize: theme.fontSize.base,
315
+ lineHeight: theme.lineHeight.base,
316
+ uni__dependencies: [0]
317
+ },
318
+ faint: {
319
+ flexShrink: 1,
320
+ color: theme.colors.faint,
321
+ fontFamily: fontOf(theme.fontFamily.sans),
322
+ fontSize: theme.fontSize.base,
323
+ lineHeight: theme.lineHeight.base,
324
+ uni__dependencies: [0]
325
+ },
326
+ outcome: {
327
+ gap: theme.spacing(1),
328
+ uni__dependencies: [0]
329
+ },
330
+ body: {
331
+ gap: theme.spacing(1),
332
+ borderTopWidth: 1,
333
+ borderTopColor: theme.colors["border-soft"],
334
+ paddingHorizontal: theme.spacing(4),
335
+ paddingVertical: theme.spacing(3),
336
+ uni__dependencies: [0]
337
+ },
338
+ bodyText: {
339
+ color: theme.colors.dim,
340
+ fontFamily: fontOf(theme.fontFamily.sans),
341
+ fontSize: theme.fontSize.base,
342
+ lineHeight: theme.lineHeight.base,
343
+ uni__dependencies: [0]
344
+ },
345
+ status: {
346
+ color: theme.colors.faint,
347
+ fontFamily: fontOf(theme.fontFamily.sans),
348
+ fontSize: theme.fontSize.sm,
349
+ lineHeight: theme.lineHeight.sm,
350
+ uni__dependencies: [0]
351
+ },
352
+ glyph: (tone) => ({
353
+ color: theme.colors[STATUS_COLORS[tone].ink],
354
+ uni__dependencies: [0]
355
+ }),
356
+ more: { alignSelf: "flex-start" }
357
+ }));
358
+
359
+ //#endregion
360
+ export { MessageItem, MessageItemBody, MessageItemGroup, MessageItemHeader, MessageItemStatus, STATUS_GLYPH, STATUS_LABEL, toolTone, useMessageItem };
361
+ //# sourceMappingURL=MessageItem.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MessageItem.mjs","names":["NativeColorToken","createContext","ReactNode","useContext","StyleProp","TextProps","ViewProps","ViewStyle","StyleSheet","AlertIcon","CheckIcon","ChevronDownIcon","ChevronRightIcon","WrenchIcon","fontOf","STATUS_COLORS","useControllable","wrapText","Button","Spinner","STATUS_EDGE","StatusBadge","StatusTone","MIN_ROW_HEIGHT","LEAD_CHIP","ROW_EDGE_WIDTH","MessageItemState","tone","expandable","expanded","toggle","MessageItemContext","undefined","useMessageItem","MessageItemGroupContext","toolTone","state","running","isError","STATUS_LABEL","Readonly","Record","neutral","ok","error","info","accent","STATUS_GLYPH","cardEdge","rowEdge","MessageItemProps","Omit","defaultExpanded","onExpandedChange","children","style","MessageItem","props","current","setExpanded","group","styles","Summary","summary","summaryText","ToolCallLead","title","chip","lead","caption","titleLine","OutcomeBadge","ink","outcome","MessageItemGroupProps","badge","MessageItemGroup","label","header","faint","MessageItemHeaderProps","SILENT_IN_GROUP","ReadonlySet","Set","MessageItemHeader","defaultLabel","has","content","pressed","headerPressed","MessageItemPartProps","MessageItemBody","body","bodyText","MessageItemStatusProps","glyph","expands","containerStyle","MessageItemStatus","line","status","more","create","theme","token","overflow","borderRadius","lg","borderWidth","borderColor","colors","uni__dependencies","borderTopWidth","borderTopColor","borderLeftWidth","borderLeftColor","flexDirection","alignItems","gap","spacing","minHeight","paddingHorizontal","paddingVertical","backgroundColor","panel","justifyContent","width","height","flexShrink","full","rail","flex","minWidth","color","dim","fontFamily","sans","fontSize","sm","lineHeight","hi","base","fontWeight","semibold","alignSelf"],"sources":["../../src/components/MessageItem.tsx"],"sourcesContent":["import type { NativeColorToken } from '@agimon-ai/po-web-components/nativeTheme';\nimport { 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 { AlertIcon, CheckIcon, ChevronDownIcon, ChevronRightIcon, WrenchIcon } from '../icons/icons';\nimport { fontOf } from '../lib/fonts';\nimport { STATUS_COLORS } from '../lib/tone';\nimport { useControllable } from '../lib/useControllable';\nimport { wrapText } from '../lib/wrapText';\nimport { Button } from './Button';\nimport { Spinner } from './Spinner';\nimport { STATUS_EDGE, StatusBadge, type StatusTone } from './StatusBadge';\n\n/*\n * The message item: the timeline card a tool call, a run or a notice sits in.\n * The item owns its outcome tone and its expand state; the header, body and\n * status parts read both from it, so a card composes the parts and never\n * threads `expanded` by hand. The header is one Pressable that expands the\n * item, the native stand-in for the web's small chevron button.\n */\n\nconst MIN_ROW_HEIGHT = 44;\nconst LEAD_CHIP = 36;\nconst ROW_EDGE_WIDTH = 2;\n\nexport interface MessageItemState {\n tone: StatusTone;\n /** Whether the header offers the toggle; an item that hides nothing offers none. */\n expandable: boolean;\n expanded: boolean;\n toggle: () => void;\n}\n\nconst MessageItemContext = createContext<MessageItemState>({\n tone: 'neutral',\n expandable: false,\n expanded: false,\n toggle: () => undefined,\n});\n\n/** The enclosing item's state, for a part that lives deeper than the item's render prop. */\nexport function useMessageItem(): MessageItemState {\n return useContext(MessageItemContext);\n}\n\n/** The group an item is a row of, or null for an item that is a card of its own. */\nconst MessageItemGroupContext = createContext<{ tone: StatusTone } | null>(null);\n\n/** The tone a tool call's item wears: running while the tool runs, then its outcome. */\nexport function toolTone(state: { running: boolean; isError: boolean }): StatusTone {\n return state.running ? 'running' : state.isError ? 'error' : 'ok';\n}\n\n/** The badge text a tone reads as when the header is not told otherwise; empty hides the badge. */\nexport const STATUS_LABEL: Readonly<Record<StatusTone, string>> = {\n neutral: '',\n running: 'Running',\n ok: 'Completed',\n error: 'Failed',\n info: 'Info',\n accent: 'Note',\n};\n\n/** The glyph a tone reads as in a status line. */\nexport const STATUS_GLYPH: Readonly<Record<StatusTone, string>> = {\n neutral: '\\u2026',\n running: '\\u25d0',\n ok: '\\u2713',\n error: '\\u2717',\n info: '\\u25cf',\n accent: '\\u25cf',\n};\n\n/** A settled OK is the calm default and keeps the soft border; only work in flight or a failure colours the edge. */\nfunction cardEdge(tone: StatusTone): NativeColorToken {\n return tone === 'ok' ? 'border-soft' : STATUS_EDGE[tone];\n}\n\n/** As a row, a settled or neutral item keeps a quiet edge. */\nfunction rowEdge(tone: StatusTone): NativeColorToken | undefined {\n return tone === 'ok' || tone === 'neutral' ? undefined : STATUS_EDGE[tone];\n}\n\nexport interface MessageItemProps extends Omit<ViewProps, 'children' | 'style'> {\n tone?: StatusTone;\n /** Whether the header offers the expand toggle. A toggle that reveals nothing reads as broken, so the card decides. */\n expandable?: boolean;\n defaultExpanded?: boolean;\n /** Controlled mode; pair with onExpandedChange. Omit it and the item keeps its own state. */\n expanded?: boolean;\n onExpandedChange?: (expanded: boolean) => void;\n /** Plain content, or a function of the item's state for a card that picks its lines by `expanded`. */\n children?: ReactNode | ((state: MessageItemState) => ReactNode);\n style?: StyleProp<ViewStyle>;\n}\n\nexport function MessageItem({\n tone = 'neutral',\n expandable = false,\n defaultExpanded = false,\n expanded,\n onExpandedChange,\n children,\n style,\n ...props\n}: MessageItemProps) {\n const [current, setExpanded] = useControllable(expanded, defaultExpanded, onExpandedChange);\n const group = useContext(MessageItemGroupContext);\n const state: MessageItemState = { tone, expandable, expanded: current, toggle: () => setExpanded(!current) };\n return (\n <MessageItemContext.Provider value={state}>\n <View\n style={[group === null ? styles.cardEdge(cardEdge(tone)) : styles.rowEdge(rowEdge(tone)), style]}\n {...props}\n >\n {typeof children === 'function' ? children(state) : children}\n </View>\n </MessageItemContext.Provider>\n );\n}\n\n/** The line beside the title; a bare string stays on one line and truncates, as the web's `truncate`. */\nfunction Summary({ children }: { children?: ReactNode }) {\n return (\n <View style={styles.summary}>\n {typeof children === 'string' ? (\n <Text numberOfLines={1} style={styles.summaryText}>\n {children}\n </Text>\n ) : (\n wrapText(children, styles.summaryText)\n )}\n </View>\n );\n}\n\n/** The card's lead: the tool chip, the \"Tool call\" caption, then the name and its summary on one line. */\nfunction ToolCallLead({ title, children }: { title: ReactNode; children?: ReactNode }) {\n return (\n <>\n <View accessible={false} style={styles.chip}>\n <WrenchIcon size={16} />\n </View>\n <View style={styles.lead}>\n <Text style={styles.caption}>Tool call</Text>\n <View style={styles.titleLine}>\n {wrapText(title, styles.title)}\n <Summary>{children}</Summary>\n </View>\n </View>\n </>\n );\n}\n\n/** The sentence-case outcome pill, led by the tone's icon. */\nfunction OutcomeBadge({ tone, children }: { tone: StatusTone; children: ReactNode }) {\n const ink = STATUS_COLORS[tone].ink;\n return (\n <StatusBadge tone={tone} size=\"md\" style={styles.outcome}>\n {tone === 'running' ? <Spinner color={ink} /> : null}\n {tone === 'ok' ? <CheckIcon size={12} color={ink} /> : null}\n {tone === 'error' ? <AlertIcon size={12} color={ink} /> : null}\n {children}\n </StatusBadge>\n );\n}\n\nexport interface MessageItemGroupProps extends Omit<ViewProps, 'children' | 'style'> {\n tone?: StatusTone;\n /** The bold label at the left of the group header: the tool the run belongs to. */\n title: ReactNode;\n /** The line beside it, such as how many calls the group holds. */\n summary?: ReactNode;\n /** The badge text; defaults to the tone's label, null hides the badge. */\n badge?: ReactNode | null;\n children?: ReactNode;\n style?: StyleProp<ViewStyle>;\n}\n\n/**\n * One frame around a run of items that belong together. Each item inside\n * becomes a row: same header, same expand, no card of its own, and its tone\n * an edge down its left side.\n */\nexport function MessageItemGroup({\n tone = 'neutral',\n title,\n summary,\n badge,\n children,\n style,\n ...props\n}: MessageItemGroupProps) {\n const label = badge === undefined ? STATUS_LABEL[tone] : badge;\n return (\n <MessageItemGroupContext.Provider value={{ tone }}>\n <View style={[styles.cardEdge(cardEdge(tone)), style]} {...props}>\n <View accessibilityRole=\"header\" style={styles.header}>\n <ToolCallLead title={title}>\n {typeof summary === 'string' ? (\n <Text numberOfLines={1} style={styles.faint}>\n {summary}\n </Text>\n ) : (\n summary\n )}\n </ToolCallLead>\n {label !== null && label !== '' ? <OutcomeBadge tone={tone}>{label}</OutcomeBadge> : null}\n </View>\n <View>{children}</View>\n </View>\n </MessageItemGroupContext.Provider>\n );\n}\n\nexport interface MessageItemHeaderProps extends Omit<ViewProps, 'children' | 'style'> {\n /** The bold label at the left: the tool name. */\n title: ReactNode;\n /** The badge text; defaults to the tone's label, null hides the badge. */\n badge?: ReactNode | null;\n /** The summary beside the title; it gets the remaining width. */\n children?: ReactNode;\n style?: StyleProp<ViewStyle>;\n}\n\n/** Inside a group these two are the quiet outcome: the group's header has already said it. */\nconst SILENT_IN_GROUP: ReadonlySet<StatusTone> = new Set<StatusTone>(['ok', 'neutral']);\n\n/**\n * The title row: label, summary, the tone's badge and, when the item is\n * expandable, a chevron; the whole row is the toggle. A row inside a group\n * drops its title and speaks up only when something failed or is running.\n */\nexport function MessageItemHeader({ title, badge, children, style, ...props }: MessageItemHeaderProps) {\n const { tone, expandable, expanded, toggle } = useMessageItem();\n const group = useContext(MessageItemGroupContext);\n const defaultLabel = group !== null && SILENT_IN_GROUP.has(tone) ? null : STATUS_LABEL[tone];\n const label = badge === undefined ? defaultLabel : badge;\n const content = (\n <>\n {group === null ? <ToolCallLead title={title}>{children}</ToolCallLead> : <Summary>{children}</Summary>}\n {label !== null && label !== '' ? <OutcomeBadge tone={tone}>{label}</OutcomeBadge> : null}\n {expandable ? expanded ? <ChevronDownIcon size={16} /> : <ChevronRightIcon size={16} /> : null}\n </>\n );\n if (!expandable) {\n return (\n <View style={[styles.header, style]} {...props}>\n {content}\n </View>\n );\n }\n return (\n <Pressable\n accessibilityRole=\"button\"\n accessibilityState={{ expanded }}\n accessibilityHint={expanded ? 'collapse' : 'expand'}\n onPress={toggle}\n style={({ pressed }) => [styles.header, pressed && styles.headerPressed, style]}\n {...props}\n >\n {content}\n </Pressable>\n );\n}\n\nexport interface MessageItemPartProps extends Omit<ViewProps, 'children' | 'style'> {\n children?: ReactNode;\n style?: StyleProp<ViewStyle>;\n}\n\n/** The body under the header, on the card's own surface. */\nexport function MessageItemBody({ children, style, ...props }: MessageItemPartProps) {\n return (\n <View style={[styles.body, style]} {...props}>\n {wrapText(children, styles.bodyText)}\n </View>\n );\n}\n\nexport interface MessageItemStatusProps extends Omit<TextProps, 'children'> {\n tone?: StatusTone;\n /** Replaces the tone's glyph. */\n glyph?: string;\n /** Renders as a button that expands the item: the \"N more line(s)\" hint. */\n expands?: boolean;\n children?: ReactNode;\n /** Applied to the row; with `expands`, to the button. */\n containerStyle?: StyleProp<ViewStyle>;\n}\n\n/** The one-line status under a body: `running`, `failed`, `done`, or the hint that more is hidden. */\nexport function MessageItemStatus({\n tone = 'neutral',\n glyph,\n expands = false,\n children,\n containerStyle,\n style,\n ...props\n}: MessageItemStatusProps) {\n const { toggle } = useMessageItem();\n const line = (\n <Text style={[styles.status, style]} {...props}>\n <Text style={styles.glyph(tone)}>{glyph ?? STATUS_GLYPH[tone]}</Text> {children}\n </Text>\n );\n if (expands) {\n return (\n <Button variant=\"ghost\" size=\"xs\" onPress={toggle} style={[styles.more, containerStyle]}>\n {line}\n </Button>\n );\n }\n return <View style={containerStyle}>{line}</View>;\n}\n\nconst styles = StyleSheet.create((theme) => ({\n cardEdge: (token: NativeColorToken) => ({\n overflow: 'hidden',\n borderRadius: theme.borderRadius.lg,\n borderWidth: 1,\n borderColor: theme.colors[token],\n }),\n // A row's top rule is the group's separator; its left edge carries the tone.\n rowEdge: (token: NativeColorToken | undefined) => ({\n overflow: 'hidden',\n borderTopWidth: 1,\n borderTopColor: theme.colors['border-soft'],\n borderLeftWidth: ROW_EDGE_WIDTH,\n borderLeftColor: token === undefined ? 'transparent' : theme.colors[token],\n }),\n header: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: theme.spacing(3),\n minHeight: MIN_ROW_HEIGHT,\n paddingHorizontal: theme.spacing(4),\n paddingVertical: theme.spacing(3),\n },\n headerPressed: { backgroundColor: theme.colors.panel },\n chip: {\n alignItems: 'center',\n justifyContent: 'center',\n width: LEAD_CHIP,\n height: LEAD_CHIP,\n flexShrink: 0,\n borderRadius: theme.borderRadius.full,\n backgroundColor: theme.colors.rail,\n },\n lead: { flex: 1, minWidth: 0 },\n caption: {\n color: theme.colors.dim,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeight.sm,\n },\n titleLine: { flexDirection: 'row', alignItems: 'center', gap: theme.spacing(2), minWidth: 0 },\n title: {\n flexShrink: 0,\n color: theme.colors.hi,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.base,\n lineHeight: theme.lineHeight.base,\n fontWeight: theme.fontWeight.semibold,\n },\n summary: { flex: 1, flexDirection: 'row', alignItems: 'center', gap: theme.spacing(2), minWidth: 0 },\n summaryText: {\n flexShrink: 1,\n color: theme.colors.faint,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.base,\n lineHeight: theme.lineHeight.base,\n },\n faint: {\n flexShrink: 1,\n color: theme.colors.faint,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.base,\n lineHeight: theme.lineHeight.base,\n },\n outcome: { gap: theme.spacing(1) },\n body: {\n gap: theme.spacing(1),\n borderTopWidth: 1,\n borderTopColor: theme.colors['border-soft'],\n paddingHorizontal: theme.spacing(4),\n paddingVertical: theme.spacing(3),\n },\n bodyText: {\n color: theme.colors.dim,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.base,\n lineHeight: theme.lineHeight.base,\n },\n status: {\n color: theme.colors.faint,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeight.sm,\n },\n glyph: (tone: StatusTone) => ({ color: theme.colors[STATUS_COLORS[tone].ink] }),\n more: { alignSelf: 'flex-start' },\n}));\n"],"mappings":";;;;;;;;;;;;;;;;AAsBA,MAAMuB,iBAAiB;AACvB,MAAMC,YAAY;AAClB,MAAMC,iBAAiB;AAUvB,MAAMM,qBAAqB9B,cAAgC;CACzD0B,MAAM;CACNC,YAAY;CACZC,UAAU;CACVC,cAAcE;AAChB,CAAC;;AAGD,SAAgBC,iBAAmC;CACjD,OAAO9B,WAAW4B,kBAAkB;AACtC;;AAGA,MAAMG,0BAA0BjC,cAA2C,IAAI;;AAG/E,SAAgBkC,SAASC,OAA2D;CAClF,OAAOA,MAAMC,UAAU,YAAYD,MAAME,UAAU,UAAU;AAC/D;;AAGA,MAAaC,eAAqD;CAChEG,SAAS;CACTL,SAAS;CACTM,IAAI;CACJC,OAAO;CACPC,MAAM;CACNC,QAAQ;AACV;;AAGA,MAAaC,eAAqD;CAChEL,SAAS;CACTL,SAAS;CACTM,IAAI;CACJC,OAAO;CACPC,MAAM;CACNC,QAAQ;AACV;;AAGA,SAASE,SAASrB,MAAoC;CACpD,OAAOA,SAAS,OAAO,gBAAgBP,YAAYO;AACrD;;AAGA,SAASsB,QAAQtB,MAAgD;CAC/D,OAAOA,SAAS,QAAQA,SAAS,YAAYK,SAAYZ,YAAYO;AACvE;AAeA,SAAgB6B,YAAY,EAC1B7B,OA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AAO9B,MAAMO,OAAOwB;EACpBC,YAAYzH,OAAOyF,MAAMgC,WAAWC,IAAI;EACxCC,UAAUlC,MAAMkC,SAASI;EACzBF,YAAYpC,MAAMoC,WAAWE;EAAI9B,mBAAA,CAAA,CAAA;CACnC;CACAX,QAAQ;EACNiC,OAAO9B,MAAMO,OAAO/B;EACpBwD,YAAYzH,OAAOyF,MAAMgC,WAAWC,IAAI;EACxCC,UAAUlC,MAAMkC,SAASC;EACzBC,YAAYpC,MAAMoC,WAAWD;EAAE3B,mBAAA,CAAA,CAAA;CACjC;CACAhB,QAAQpE,UAAsB;EAAE0G,OAAO9B,MAAMO,OAAO/F,cAAcY,KAAK,CAAC6C;EAAIuC,mBAAA,CAAA,CAAA;CAAC;CAC7EV,MAAM,EAAE2C,WAAW,aAAa;AAClC,EAAE"}
@@ -0,0 +1,15 @@
1
+ import { StyleProp, ViewProps, ViewStyle } from "react-native";
2
+ import { ReactNode } from "react";
3
+ //#region src/components/Panel.d.ts
4
+ export interface PanelPartProps extends Omit<ViewProps, 'children' | 'style'> {
5
+ children?: ReactNode;
6
+ style?: StyleProp<ViewStyle>;
7
+ }
8
+ /** The bordered card surface: a tool card, a run card, a device row. */
9
+ export declare function Panel({ style, children, ...props }: PanelPartProps): import("react").JSX.Element;
10
+ /** A panel's title row; it carries the header role. */
11
+ export declare function PanelHeader({ style, children, ...props }: PanelPartProps): import("react").JSX.Element;
12
+ /** A panel's recessed body: the deep well the header sits above. */
13
+ export declare function PanelBody({ style, children, ...props }: PanelPartProps): import("react").JSX.Element;
14
+ //#endregion
15
+ //# sourceMappingURL=Panel.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Panel.d.mts","names":[],"sources":["../../src/components/Panel.tsx"],"mappings":";;;iBAOiB,uBAAuB,KAAK;EAC3C,WAAW;EACX,QAAQ,UAAU;;;wBAIJ,QAAQ,OAAO,aAAa,SAAS,iCAAc,IAAA;;wBASnD,cAAc,OAAO,aAAa,SAAS,iCAAc,IAAA;;wBASzD,YAAY,OAAO,aAAa,SAAS,iCAAc,IAAA"}
@@ -0,0 +1,77 @@
1
+ import { fontOf } from "../lib/fonts.mjs";
2
+ import { wrapText } from "../lib/wrapText.mjs";
3
+ import { View } from "react-native-unistyles/components/native/View";
4
+ import { StyleSheet } from "react-native-unistyles";
5
+ import { jsx } from "react/jsx-runtime";
6
+
7
+ //#region src/components/Panel.tsx
8
+ /** The bordered card surface: a tool card, a run card, a device row. */
9
+ function Panel({ style, children, ...props }) {
10
+ return /* @__PURE__ */ jsx(View, {
11
+ style: [styles.panel, style],
12
+ ...props,
13
+ children: wrapText(children, styles.text)
14
+ });
15
+ }
16
+ /** A panel's title row; it carries the header role. */
17
+ function PanelHeader({ style, children, ...props }) {
18
+ return /* @__PURE__ */ jsx(View, {
19
+ accessibilityRole: "header",
20
+ style: [styles.header, style],
21
+ ...props,
22
+ children: wrapText(children, styles.title)
23
+ });
24
+ }
25
+ /** A panel's recessed body: the deep well the header sits above. */
26
+ function PanelBody({ style, children, ...props }) {
27
+ return /* @__PURE__ */ jsx(View, {
28
+ style: [styles.body, style],
29
+ ...props,
30
+ children: wrapText(children, styles.text)
31
+ });
32
+ }
33
+ const styles = StyleSheet.create((theme) => ({
34
+ panel: {
35
+ overflow: "hidden",
36
+ borderRadius: theme.borderRadius.md,
37
+ borderWidth: 1,
38
+ borderColor: theme.colors.border,
39
+ backgroundColor: theme.colors.panel,
40
+ uni__dependencies: [0]
41
+ },
42
+ header: {
43
+ flexDirection: "row",
44
+ alignItems: "center",
45
+ gap: theme.spacing(2),
46
+ minHeight: theme.spacing(8),
47
+ paddingHorizontal: 11,
48
+ uni__dependencies: [0]
49
+ },
50
+ body: {
51
+ borderTopWidth: 1,
52
+ borderTopColor: theme.colors["border-soft"],
53
+ backgroundColor: theme.colors.deep,
54
+ paddingHorizontal: theme.spacing(3),
55
+ paddingVertical: theme.spacing(2),
56
+ uni__dependencies: [0]
57
+ },
58
+ title: {
59
+ color: theme.colors.hi,
60
+ fontFamily: fontOf(theme.fontFamily.sans),
61
+ fontSize: theme.fontSize.base,
62
+ lineHeight: theme.lineHeight.base,
63
+ fontWeight: theme.fontWeight.semibold,
64
+ uni__dependencies: [0]
65
+ },
66
+ text: {
67
+ color: theme.colors.dim,
68
+ fontFamily: fontOf(theme.fontFamily.sans),
69
+ fontSize: theme.fontSize.sm,
70
+ lineHeight: theme.lineHeight.sm,
71
+ uni__dependencies: [0]
72
+ }
73
+ }));
74
+
75
+ //#endregion
76
+ export { Panel, PanelBody, PanelHeader };
77
+ //# sourceMappingURL=Panel.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Panel.mjs","names":["ReactNode","StyleProp","ViewProps","ViewStyle","StyleSheet","fontOf","wrapText","PanelPartProps","Omit","children","style","Panel","props","styles","panel","text","PanelHeader","header","title","PanelBody","body","create","theme","overflow","borderRadius","md","borderWidth","borderColor","colors","border","backgroundColor","uni__dependencies","flexDirection","alignItems","gap","spacing","minHeight","paddingHorizontal","borderTopWidth","borderTopColor","deep","paddingVertical","color","hi","fontFamily","sans","fontSize","base","lineHeight","fontWeight","semibold","dim","sm"],"sources":["../../src/components/Panel.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { type StyleProp, View, type ViewProps, 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 PanelPartProps extends Omit<ViewProps, 'children' | 'style'> {\n children?: ReactNode;\n style?: StyleProp<ViewStyle>;\n}\n\n/** The bordered card surface: a tool card, a run card, a device row. */\nexport function Panel({ style, children, ...props }: PanelPartProps) {\n return (\n <View style={[styles.panel, style]} {...props}>\n {wrapText(children, styles.text)}\n </View>\n );\n}\n\n/** A panel's title row; it carries the header role. */\nexport function PanelHeader({ style, children, ...props }: PanelPartProps) {\n return (\n <View accessibilityRole=\"header\" style={[styles.header, style]} {...props}>\n {wrapText(children, styles.title)}\n </View>\n );\n}\n\n/** A panel's recessed body: the deep well the header sits above. */\nexport function PanelBody({ style, children, ...props }: PanelPartProps) {\n return (\n <View style={[styles.body, style]} {...props}>\n {wrapText(children, styles.text)}\n </View>\n );\n}\n\nconst styles = StyleSheet.create((theme) => ({\n panel: {\n overflow: 'hidden',\n borderRadius: theme.borderRadius.md,\n borderWidth: 1,\n borderColor: theme.colors.border,\n backgroundColor: theme.colors.panel,\n },\n header: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: theme.spacing(2),\n minHeight: theme.spacing(8),\n paddingHorizontal: 11,\n },\n body: {\n borderTopWidth: 1,\n borderTopColor: theme.colors['border-soft'],\n backgroundColor: theme.colors.deep,\n paddingHorizontal: theme.spacing(3),\n paddingVertical: theme.spacing(2),\n },\n title: {\n color: theme.colors.hi,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.base,\n lineHeight: theme.lineHeight.base,\n fontWeight: theme.fontWeight.semibold,\n },\n text: {\n color: theme.colors.dim,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeight.sm,\n },\n}));\n"],"mappings":";;;;;;;;AAaA,SAAgBW,MAAM,EAAED,OAAOD,UAAU,GAAGG,SAAyB;CACnE,OACE,oBAAC,MAAD;EAAM,OAAO,CAACC,OAAOC,OAAOJ,KAAK;EAAG,GAAIE;YACrCN,SAASG,UAAUI,OAAOE,IAAI;CAC3B;AAEV;;AAGA,SAAgBC,YAAY,EAAEN,OAAOD,UAAU,GAAGG,SAAyB;CACzE,OACE,oBAAC,MAAD;EAAM,mBAAkB;EAAS,OAAO,CAACC,OAAOI,QAAQP,KAAK;EAAG,GAAIE;YACjEN,SAASG,UAAUI,OAAOK,KAAK;CAC5B;AAEV;;AAGA,SAAgBC,UAAU,EAAET,OAAOD,UAAU,GAAGG,SAAyB;CACvE,OACE,oBAAC,MAAD;EAAM,OAAO,CAACC,OAAOO,MAAMV,KAAK;EAAG,GAAIE;YACpCN,SAASG,UAAUI,OAAOE,IAAI;CAC3B;AAEV;AAEA,MAAMF,SAAST,WAAWiB,QAAQC,WAAW;CAC3CR,OAAO;EACLS,UAAU;EACVC,cAAcF,MAAME,aAAaC;EACjCC,aAAa;EACbC,aAAaL,MAAMM,OAAOC;EAC1BC,iBAAiBR,MAAMM,OAAOd;EAAKiB,mBAAA,CAAA,CAAA;CACrC;CACAd,QAAQ;EACNe,eAAe;EACfC,YAAY;EACZC,KAAKZ,MAAMa,QAAQ,CAAC;EACpBC,WAAWd,MAAMa,QAAQ,CAAC;EAC1BE,mBAAmB;EAAEN,mBAAA,CAAA,CAAA;CACvB;CACAX,MAAM;EACJkB,gBAAgB;EAChBC,gBAAgBjB,MAAMM,OAAO;EAC7BE,iBAAiBR,MAAMM,OAAOY;EAC9BH,mBAAmBf,MAAMa,QAAQ,CAAC;EAClCM,iBAAiBnB,MAAMa,QAAQ,CAAC;EAACJ,mBAAA,CAAA,CAAA;CACnC;CACAb,OAAO;EACLwB,OAAOpB,MAAMM,OAAOe;EACpBC,YAAYvC,OAAOiB,MAAMsB,WAAWC,IAAI;EACxCC,UAAUxB,MAAMwB,SAASC;EACzBC,YAAY1B,MAAM0B,WAAWD;EAC7BE,YAAY3B,MAAM2B,WAAWC;EAAQnB,mBAAA,CAAA,CAAA;CACvC;CACAhB,MAAM;EACJ2B,OAAOpB,MAAMM,OAAOuB;EACpBP,YAAYvC,OAAOiB,MAAMsB,WAAWC,IAAI;EACxCC,UAAUxB,MAAMwB,SAASM;EACzBJ,YAAY1B,MAAM0B,WAAWI;EAAErB,mBAAA,CAAA,CAAA;CACjC;AACF,EAAE"}
@@ -0,0 +1,15 @@
1
+ import { StyleProp, ViewStyle } from "react-native";
2
+ import { ReactNode } from "react";
3
+ //#region src/components/PoNativeProvider.d.ts
4
+ export interface PoNativeProviderProps {
5
+ children?: ReactNode;
6
+ style?: StyleProp<ViewStyle>;
7
+ }
8
+ /**
9
+ * The roots every native component needs once: gesture handling and the
10
+ * bottom sheet host. Mount it once at the app root, inside SafeAreaProvider,
11
+ * and around any story that renders a sheet, dialog or menu.
12
+ */
13
+ export declare function PoNativeProvider({ children, style }: PoNativeProviderProps): import("react").JSX.Element;
14
+ //#endregion
15
+ //# sourceMappingURL=PoNativeProvider.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PoNativeProvider.d.mts","names":[],"sources":["../../src/components/PoNativeProvider.tsx"],"mappings":";;;iBAMiB;EACf,WAAW;EACX,QAAQ,UAAU;;;;;;;wBAQJ,mBAAmB,UAAU,SAAS,wCAAqB,IAAA"}
@@ -0,0 +1,22 @@
1
+ import { StyleSheet } from "react-native-unistyles";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { BottomSheetModalProvider } from "@gorhom/bottom-sheet";
4
+ import { GestureHandlerRootView } from "react-native-gesture-handler";
5
+
6
+ //#region src/components/PoNativeProvider.tsx
7
+ /**
8
+ * The roots every native component needs once: gesture handling and the
9
+ * bottom sheet host. Mount it once at the app root, inside SafeAreaProvider,
10
+ * and around any story that renders a sheet, dialog or menu.
11
+ */
12
+ function PoNativeProvider({ children, style }) {
13
+ return /* @__PURE__ */ jsx(GestureHandlerRootView, {
14
+ style: [styles.root, style],
15
+ children: /* @__PURE__ */ jsx(BottomSheetModalProvider, { children })
16
+ });
17
+ }
18
+ const styles = StyleSheet.create({ root: { flex: 1 } });
19
+
20
+ //#endregion
21
+ export { PoNativeProvider };
22
+ //# sourceMappingURL=PoNativeProvider.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PoNativeProvider.mjs","names":["BottomSheetModalProvider","ReactNode","StyleProp","ViewStyle","GestureHandlerRootView","StyleSheet","PoNativeProviderProps","children","style","PoNativeProvider","styles","root","create","flex"],"sources":["../../src/components/PoNativeProvider.tsx"],"sourcesContent":["import { BottomSheetModalProvider } from '@gorhom/bottom-sheet';\nimport type { ReactNode } from 'react';\nimport type { StyleProp, ViewStyle } from 'react-native';\nimport { GestureHandlerRootView } from 'react-native-gesture-handler';\nimport { StyleSheet } from 'react-native-unistyles';\n\nexport interface PoNativeProviderProps {\n children?: ReactNode;\n style?: StyleProp<ViewStyle>;\n}\n\n/**\n * The roots every native component needs once: gesture handling and the\n * bottom sheet host. Mount it once at the app root, inside SafeAreaProvider,\n * and around any story that renders a sheet, dialog or menu.\n */\nexport function PoNativeProvider({ children, style }: PoNativeProviderProps) {\n return (\n <GestureHandlerRootView style={[styles.root, style]}>\n <BottomSheetModalProvider>{children}</BottomSheetModalProvider>\n </GestureHandlerRootView>\n );\n}\n\nconst styles = StyleSheet.create({ root: { flex: 1 } });\n"],"mappings":";;;;;;;;;;;AAgBA,SAAgBS,iBAAiB,EAAEF,UAAUC,SAAgC;CAC3E,OACE,oBAAC,wBAAD;EAAwB,OAAO,CAACE,OAAOC,MAAMH,KAAK;YAChD,oBAAC,0BAAD,EAA2BD,SAAmC;CACxC;AAE5B;AAEA,MAAMG,SAASL,WAAWO,OAAO,EAAED,MAAM,EAAEE,MAAM,EAAE,EAAE,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { TextProps } from "react-native";
2
+ //#region src/components/SectionLabel.d.ts
3
+ /** The quiet sentence-case heading over a section (Sessions, Activity, Devices). */
4
+ export declare function SectionLabel({ style, children, ...props }: TextProps): import("react").JSX.Element;
5
+ //#endregion
6
+ //# sourceMappingURL=SectionLabel.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SectionLabel.d.mts","names":[],"sources":["../../src/components/SectionLabel.tsx"],"mappings":";;;wBAuBgB,eAAe,OAAO,aAAa,SAAS,4BAAS,IAAA"}
@@ -0,0 +1,40 @@
1
+ import { fontOf } from "../lib/fonts.mjs";
2
+ import { StyleSheet } from "react-native-unistyles";
3
+ import { Text } from "react-native-unistyles/components/native/Text";
4
+ import { jsx } from "react/jsx-runtime";
5
+
6
+ //#region src/components/SectionLabel.tsx
7
+ function raiseFirst(text) {
8
+ return text.charAt(0).toUpperCase() + text.slice(1);
9
+ }
10
+ /**
11
+ * Native Text has no `first-letter`, so the label is raised to sentence case
12
+ * here: a lone string, or the leading string of mixed children such as
13
+ * `size {size}`.
14
+ */
15
+ function sentenceCase(children) {
16
+ if (typeof children === "string") return raiseFirst(children);
17
+ if (Array.isArray(children) && typeof children[0] === "string") return [raiseFirst(children[0]), ...children.slice(1)];
18
+ return children;
19
+ }
20
+ /** The quiet sentence-case heading over a section (Sessions, Activity, Devices). */
21
+ function SectionLabel({ style, children, ...props }) {
22
+ return /* @__PURE__ */ jsx(Text, {
23
+ accessibilityRole: "header",
24
+ style: [styles.label, style],
25
+ ...props,
26
+ children: sentenceCase(children)
27
+ });
28
+ }
29
+ const styles = StyleSheet.create((theme) => ({ label: {
30
+ color: theme.colors.dim,
31
+ fontFamily: fontOf(theme.fontFamily.sans),
32
+ fontSize: theme.fontSize.sm,
33
+ lineHeight: theme.lineHeight.sm,
34
+ fontWeight: theme.fontWeight.semibold,
35
+ uni__dependencies: [0]
36
+ } }));
37
+
38
+ //#endregion
39
+ export { SectionLabel };
40
+ //# sourceMappingURL=SectionLabel.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SectionLabel.mjs","names":["TextProps","StyleSheet","fontOf","raiseFirst","text","charAt","toUpperCase","slice","sentenceCase","children","Array","isArray","SectionLabel","style","props","styles","label","create","theme","color","colors","dim","fontFamily","sans","fontSize","sm","lineHeight","fontWeight","semibold","uni__dependencies"],"sources":["../../src/components/SectionLabel.tsx"],"sourcesContent":["import { Text, type TextProps } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport { fontOf } from '../lib/fonts';\n\nfunction raiseFirst(text: string): string {\n return text.charAt(0).toUpperCase() + text.slice(1);\n}\n\n/**\n * Native Text has no `first-letter`, so the label is raised to sentence case\n * here: a lone string, or the leading string of mixed children such as\n * `size {size}`.\n */\nfunction sentenceCase(children: TextProps['children']): TextProps['children'] {\n if (typeof children === 'string') return raiseFirst(children);\n if (Array.isArray(children) && typeof children[0] === 'string') {\n return [raiseFirst(children[0]), ...children.slice(1)];\n }\n return children;\n}\n\n/** The quiet sentence-case heading over a section (Sessions, Activity, Devices). */\nexport function SectionLabel({ style, children, ...props }: TextProps) {\n return (\n <Text accessibilityRole=\"header\" style={[styles.label, style]} {...props}>\n {sentenceCase(children)}\n </Text>\n );\n}\n\nconst styles = StyleSheet.create((theme) => ({\n label: {\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}));\n"],"mappings":";;;;;;AAKA,SAASG,WAAWC,MAAsB;CACxC,OAAOA,KAAKC,OAAO,CAAC,CAAC,CAACC,YAAY,IAAIF,KAAKG,MAAM,CAAC;AACpD;;;;;;AAOA,SAASC,aAAaC,UAAwD;CAC5E,IAAI,OAAOA,aAAa,UAAU,OAAON,WAAWM,QAAQ;CAC5D,IAAIC,MAAMC,QAAQF,QAAQ,KAAK,OAAOA,SAAS,OAAO,UACpD,OAAO,CAACN,WAAWM,SAAS,EAAE,GAAG,GAAGA,SAASF,MAAM,CAAC,CAAC;CAEvD,OAAOE;AACT;;AAGA,SAAgBG,aAAa,EAAEC,OAAOJ,UAAU,GAAGK,SAAoB;CACrE,OACE,oBAAC,MAAD;EAAM,mBAAkB;EAAS,OAAO,CAACC,OAAOC,OAAOH,KAAK;EAAG,GAAIC;YAChEN,aAAaC,QAAQ;CAClB;AAEV;AAEA,MAAMM,SAASd,WAAWgB,QAAQC,WAAW,EAC3CF,OAAO;CACLG,OAAOD,MAAME,OAAOC;CACpBC,YAAYpB,OAAOgB,MAAMI,WAAWC,IAAI;CACxCC,UAAUN,MAAMM,SAASC;CACzBC,YAAYR,MAAMQ,WAAWD;CAC7BE,YAAYT,MAAMS,WAAWC;CAAQC,mBAAA,CAAA,CAAA;AACvC,EACF,EAAE"}
@@ -0,0 +1,26 @@
1
+ import { StyleProp, ViewStyle } from "react-native";
2
+ //#region src/components/SegmentedControl.d.ts
3
+ export interface SegmentedControlOption {
4
+ value: string;
5
+ label: string;
6
+ }
7
+ export interface SegmentedControlProps {
8
+ /** The segments, in order. */
9
+ options: readonly SegmentedControlOption[];
10
+ /** The selected option's value. */
11
+ value: string;
12
+ onValueChange: (value: string) => void;
13
+ disabled?: boolean;
14
+ /** What the control is for, such as "Status". */
15
+ accessibilityLabel?: string;
16
+ style?: StyleProp<ViewStyle>;
17
+ }
18
+ /**
19
+ * A short exclusive choice, such as a task's status: the platform's own
20
+ * segmented control on iOS, the library's drawn fallback elsewhere, with a
21
+ * selection tick on each change. It is the native stand-in for a web Select
22
+ * with a handful of options.
23
+ */
24
+ export declare function SegmentedControl({ options, value, onValueChange, disabled, accessibilityLabel, style }: SegmentedControlProps): import("react").JSX.Element;
25
+ //#endregion
26
+ //# sourceMappingURL=SegmentedControl.d.mts.map