@agimon-ai/po-native-components 0.0.0-alpha.160 → 0.0.0-alpha.161

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 (2) hide show
  1. package/README.md +9 -51
  2. package/package.json +5 -5
package/README.md CHANGED
@@ -1,16 +1,10 @@
1
- # @agimon-ai/po-native-components
1
+ # Po native components
2
2
 
3
- The React Native component library for Po's native client and its native plugins. It gives native
4
- code the web library's look and API (`@agimon-ai/po-web-components`) built on native parts: the
5
- platform activity indicator, Pressable with an Android ripple and 44pt tap targets, SF Symbols on
6
- iOS and Material icons elsewhere, and a small haptics policy.
3
+ Shared React Native components for the Po app and native plugins. Use them instead of rebuilding buttons, forms, lists, sheets, dialogs, transcript items, or file views in each plugin. They share Po's semantic palette with the web library while using native controls, accessibility roles, touch targets, and platform icons.
7
4
 
8
5
  ## Use
9
6
 
10
- Mount `PoNativeProvider` once at the app root, inside `SafeAreaProvider`. It supplies the gesture
11
- handler root and the bottom sheet host that sheets, dialogs and menus need. Register Po's native
12
- themes with Unistyles (`NATIVE_THEMES` from `@agimon-ai/po-web-components/nativeTheme`) before this
13
- package is imported.
7
+ Register the native Unistyles themes from `@agimon-ai/po-web-components/nativeTheme` before importing this package. Mount `PoNativeProvider` once inside the app's `SafeAreaProvider`; it supplies the gesture root and bottom-sheet host.
14
8
 
15
9
  ```tsx
16
10
  import { Button, PoNativeProvider } from '@agimon-ai/po-native-components';
@@ -22,50 +16,14 @@ import { Button, PoNativeProvider } from '@agimon-ai/po-native-components';
22
16
  </PoNativeProvider>;
23
17
  ```
24
18
 
25
- Plugins reach this package only through the native host module list. Its API is part of that host
26
- contract, so it only ever grows: props and exports are added, never removed or renamed.
19
+ Discover actual exports and props in [`src/exports/index.ts`](src/exports/index.ts) and colocated component stories. Web props are not automatically native contracts: for example, there is no DOM `asChild`, and sheets use native bottom-sheet behavior.
27
20
 
28
- ## Catalogue
21
+ Plugins import this package through the native host-module allowlist. That shared API is additive: do not remove or rename existing exports or props.
29
22
 
30
- | Export | Web counterpart | Native behaviour |
31
- | ----------------------------------------------------------------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
32
- | `Button` | Button (9 variants, 7 sizes) | Pressed state for hover, Android ripple, hitSlop to 44pt, light haptic on primary, danger and success |
33
- | `Label`, `Input`, `Textarea` | Label, Input, Textarea | Placeholder in `faint`, jade cursor, autocorrect off, focus edge at 60% green |
34
- | `Spinner` | Spinner | `ActivityIndicator` in a theme token; a labelled spinner is a live progress indicator |
35
- | `Badge`, `StatusBadge`, `STATUS_EDGE`, `Dot` | Same | Accent edges at 40% alpha; `Dot` pulses with RN `Animated` |
36
- | `EmptyState`, `SectionLabel`, `Panel`, `PanelHeader`, `PanelBody` | Same | Headings carry the header role |
37
- | `List`, `ListRow` | None (the web uses card buttons) | FlashList; hairline separators, iOS disclosure chevron, selected rows on a green tint, `startAtBottom` for a chat list |
38
- | `Sheet` and its parts | Sheet (`side` and `width` dropped) | `BottomSheetModal`: drag handle, sized to content, drag down, backdrop tap or Android back closes; fields inside switch to the sheet's own input |
39
- | `Dialog` and its parts | Dialog (`width`, footer `plain` or `bar`) | RN `Modal` with an `Animated` pop; centred card; Android back and a backdrop tap close it |
40
- | `DropdownMenu` and its parts | DropdownMenu (no submenus yet) | An action list in a bottom sheet; selection haptic; destructive items in red |
41
- | `Tabs` and its parts, `TabBadge` | Tabs | Horizontal `ScrollView`; tab roles; active tab on a green tint; selection haptic |
42
- | `SegmentedControl` | Select (task status) | segmented-control through `withUnistyles`; native on iOS, the library's fallback elsewhere |
43
- | `CodeBlock` | CodeBlock (`text`, `language`) | Horizontal scroll, selectable mono text, expo-clipboard copy; no colouring or mermaid yet |
44
- | `Markdown` | Markdown (`text`, `onFileLink`) | The package's own parser; links open with `Linking`; no tables, images or blockquotes yet |
45
- | `MessageItem` and its parts, `toolTone`, `STATUS_LABEL` | MessageItem | The header is one Pressable that expands the item; edge from `STATUS_EDGE`; outcome as a `StatusBadge` |
46
- | Icons (`CheckIcon` ... `CloseIcon`, 14) | icons.ts, same names | SF Symbols on iOS, MaterialIcons on Android and web |
47
- | `PoNativeProvider` | None | `GestureHandlerRootView` and `BottomSheetModalProvider` |
48
- | `fontOf`, `impactLight`, `selectionTick` | None | Per-platform font family; the haptics policy |
23
+ ## Build and stories
49
24
 
50
- `asChild` has no native equivalent and is dropped. Colours always come from the Unistyles theme;
51
- alpha mixes are computed in render because Unistyles hands stylesheets CSS variables on web.
25
+ `tsdown` emits unbundled ESM with bare dependencies external, so Metro uses the app's single React, Unistyles, and native-library instances. The build applies the Unistyles Babel rewrite before publication.
52
26
 
53
- ## Build
27
+ Component stories are titled `Native/Components/<Name>`. Preview them through the repository's style-system tooling and preserve their identities through implementation. The story-only theme setup in `src/unistyles.ts` is not exported.
54
28
 
55
- `tsdown` emits ESM only (`exports['.']` is `{types, default}`), unbundled, with every bare import
56
- external, so each native library resolves from the app's single copy. The Unistyles Babel rewrite
57
- runs at build time through `unistylesBabel` from `@agimon-ai/po-build/tsdown`.
58
-
59
- ## Stories
60
-
61
- Each component has a colocated `*.stories.tsx` titled `Native/Components/<Name>`, rendered from the
62
- repository root:
63
-
64
- ```sh
65
- pnpm exec style-system get-ui-component -c 'Native/Components/Button' -a packages/core/po-native-components -s Playground
66
- ```
67
-
68
- `src/unistyles.ts` registers the themes for story renders only and is never exported. Story renders
69
- run on react-native-web, so they cannot show SF Symbols, haptics or native ripples; check those on
70
- a device. The SegmentedControl story does not render: style-system's bundler cannot parse the Flow
71
- source segmented-control ships for its non-iOS fallback.
29
+ React Native Web previews do not verify SF Symbols, haptics, ripples, native sheets, or device accessibility behavior. Check those on the target platform. A rendered story is not human approval.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agimon-ai/po-native-components",
3
- "version": "0.0.0-alpha.160",
3
+ "version": "0.0.0-alpha.161",
4
4
  "description": "Shared React Native components for Po and its native plugins: the web component library's look and API on native parts, tuned to the Po palette.",
5
5
  "keywords": [
6
6
  "ai",
@@ -49,12 +49,12 @@
49
49
  "access": "public"
50
50
  },
51
51
  "dependencies": {
52
- "@agimon-ai/po-web-components": "0.0.0-alpha.160"
52
+ "@agimon-ai/po-web-components": "0.0.0-alpha.161"
53
53
  },
54
54
  "devDependencies": {
55
- "@agimon-ai/po-build": "0.0.0-alpha.160",
56
- "@agimon-ai/po-core": "0.0.0-alpha.160",
57
- "@agimon-ai/vibe-lint-plugin-po-web": "0.0.0-alpha.160",
55
+ "@agimon-ai/po-build": "0.0.0-alpha.161",
56
+ "@agimon-ai/po-core": "0.0.0-alpha.161",
57
+ "@agimon-ai/vibe-lint-plugin-po-web": "0.0.0-alpha.161",
58
58
  "@babel/core": "7.29.7",
59
59
  "@expo/vector-icons": "15.1.1",
60
60
  "@fontsource-variable/ibm-plex-sans": "5.3.0",