@xoroh/axis 0.1.0 → 0.1.1

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.
package/README.md CHANGED
@@ -1,69 +1,89 @@
1
1
  # `@xoroh/axis`
2
2
 
3
- Design-system-neutral, native-first behavior and interaction primitives
4
- for React Native — the counterpart of Base UI for native. Composable
5
- state models, hooks, and unstyled rendered components with no token
6
- reads, no styling, and no web-only APIs.
3
+ Unstyled, accessible UI components and native interaction primitives for React Native.
7
4
 
8
- Axis is independent and standalone: it never depends on Kern, Kern
9
- tokens, or any design system, and it is usable without Kern.
10
- Design-system variants (Material, Astryx, …) live in the consuming
11
- system, never here.
5
+ Axis provides composable state models, hooks, and unstyled rendered components with complete control over styling, full accessibility support, and native-first behavior — with zero CSS assumptions, no design system opinions, and no web-only API leaks.
12
6
 
13
- ## Install
7
+ - **Unstyled & headless:** You have 100% control over layout, styling, and design system integration.
8
+ - **Native-first accessibility:** Built specifically around React Native's accessibility model (`aria-*`, roles, focus order, announcements).
9
+ - **Separation of concerns:** Pure state models live in `@xoroh/axis/models` (pure TypeScript/JS, no React Native runtime dependency). Rendered components live in `@xoroh/axis`.
14
10
 
15
- ```sh
16
- bun add @xoroh/axis react react-native
17
- ```
11
+ ## Scope and independence
12
+
13
+ Axis is standalone and design-system neutral: it contains no hardcoded tokens, themes, or styling rules. Any design system or visual theme can be built on top of Axis primitives.
18
14
 
19
- Nothing is published yet (version `0.0.0`; releases are owner-gated
20
- — see [`docs/RELEASING.md`](https://github.com/xoroh/axis/blob/main/docs/RELEASING.md)).
21
- Until the first release, install from source with the same
22
- pack-vendor flow Kern uses to vendor Axis:
15
+ ## Install
23
16
 
24
17
  ```sh
25
- git clone https://github.com/xoroh/axis.git && cd axis
26
- bun install --frozen-lockfile
27
- node scripts/pack-vendor.mjs --out /tmp/axis-vendor
28
- # prints /tmp/axis-vendor/axis-<short-sha>.tgz + sha512 — add it
29
- # in your app: bun add /tmp/axis-vendor/axis-<short-sha>.tgz
18
+ bun add @xoroh/axis react react-native
19
+ # or
20
+ npm install @xoroh/axis react react-native
21
+ # or
22
+ yarn add @xoroh/axis react react-native # Yarn Classic does not install peer dependencies automatically
30
23
  ```
31
24
 
32
- Peers: `react >= 18`; rendered components additionally need
33
- `react-native >=0.86 <0.89` (D-STACK support policy). The behavior
34
- modules (`useControllableState`, `normalizeTimeValue`, …) are pure
35
- React and run anywhere React runs.
25
+ Peers: `react >= 18`; rendered components additionally need `react-native >=0.86 <0.89`. State models and behavior modules under `@xoroh/axis/models` are pure JavaScript and run anywhere React/Node/Web runs.
36
26
 
37
27
  ## Usage
38
28
 
39
29
  ```tsx
40
30
  import { useState } from "react";
41
- import { Text } from "react-native";
42
- import { DialogRoot, DialogTrigger, DialogPortal, DialogPopup } from "@xoroh/axis";
31
+ import { Text, StyleSheet } from "react-native";
32
+ import {
33
+ DialogRoot,
34
+ DialogTrigger,
35
+ DialogPortal,
36
+ DialogPopup,
37
+ DialogBackdrop,
38
+ DialogTitle,
39
+ DialogDescription,
40
+ DialogClose,
41
+ } from "@xoroh/axis";
42
+
43
+ export function ExampleDialog() {
44
+ const [open, setOpen] = useState(false);
43
45
 
44
- function Example() {
45
46
  return (
46
- <DialogRoot>
47
- <DialogTrigger>
48
- <Text>Open</Text>
47
+ <DialogRoot open={open} onOpenChange={setOpen}>
48
+ <DialogTrigger style={styles.button}>
49
+ <Text style={styles.buttonText}>Open Dialog</Text>
49
50
  </DialogTrigger>
50
51
  <DialogPortal>
51
- <DialogPopup aria-label="Example dialog">
52
- <Text>Hello</Text>
52
+ <DialogBackdrop style={styles.backdrop} />
53
+ <DialogPopup style={styles.popup} aria-label="Example dialog">
54
+ <DialogTitle style={styles.title}>Edit profile</DialogTitle>
55
+ <DialogDescription style={styles.description}>
56
+ Make changes to your profile here. Click save when you're done.
57
+ </DialogDescription>
58
+ <DialogClose style={styles.closeButton}>
59
+ <Text>Done</Text>
60
+ </DialogClose>
53
61
  </DialogPopup>
54
62
  </DialogPortal>
55
63
  </DialogRoot>
56
64
  );
57
65
  }
66
+
67
+ const styles = StyleSheet.create({
68
+ button: { padding: 12, borderRadius: 8, backgroundColor: "#007AFF" },
69
+ buttonText: { color: "#FFF", fontWeight: "600" },
70
+ backdrop: { ...StyleSheet.absoluteFillObject, backgroundColor: "rgba(0,0,0,0.5)" },
71
+ popup: { margin: 24, padding: 24, borderRadius: 12, backgroundColor: "#FFF" },
72
+ title: { fontSize: 18, fontWeight: "700", marginBottom: 8 },
73
+ description: { fontSize: 14, color: "#666", marginBottom: 16 },
74
+ closeButton: { alignSelf: "flex-end", padding: 8 },
75
+ });
58
76
  ```
59
77
 
60
- Only the documented public entry (`.`) is supported. Deep imports are
61
- not part of the contract.
78
+ For Node.js environments or tests outside React Native view trees:
79
+
80
+ ```ts
81
+ import { createToastQueue, normalizeTimeValue } from "@xoroh/axis/models";
82
+ ```
62
83
 
63
84
  ## Components
64
85
 
65
- Per-component notes (props, examples, accessibility) live in
66
- [`docs/components/`](https://github.com/xoroh/axis/tree/main/docs/components):
86
+ The package provides 43 native component primitives:
67
87
 
68
88
  <!-- index:begin -->
69
89
  | [Accordion](https://github.com/xoroh/axis/blob/main/docs/components/accordion.md) |
@@ -113,23 +133,13 @@ Per-component notes (props, examples, accessibility) live in
113
133
 
114
134
  ## Docs
115
135
 
116
- - [`docs/COMPONENT_CONTRACT.md`](https://github.com/xoroh/axis/blob/main/docs/COMPONENT_CONTRACT.md) —
117
- what a component is, and the rules every slice follows.
118
- - [`docs/BASE_UI_PARITY.md`](https://github.com/xoroh/axis/blob/main/docs/BASE_UI_PARITY.md) —
119
- per-component Base UI parity with documented native deviations.
120
- - [`docs/COVERAGE.md`](https://github.com/xoroh/axis/blob/main/docs/COVERAGE.md) —
121
- the component coverage inventory.
122
- - [`docs/COMPATIBILITY.md`](https://github.com/xoroh/axis/blob/main/docs/COMPATIBILITY.md) —
123
- what the supported ranges rest on, honestly labeled.
124
- - [`docs/RELEASING.md`](https://github.com/xoroh/axis/blob/main/docs/RELEASING.md) —
125
- manual releases only; nothing is published yet.
136
+ - [`docs/VISION.md`](https://github.com/xoroh/axis/blob/main/docs/VISION.md) — north star, design principles, non-goals, quality bar.
137
+ - [`docs/COMPONENT_CONTRACT.md`](https://github.com/xoroh/axis/blob/main/docs/COMPONENT_CONTRACT.md) — slice rules and component invariants.
138
+ - [`docs/BASE_UI_PARITY.md`](https://github.com/xoroh/axis/blob/main/docs/BASE_UI_PARITY.md) — Base UI parity mapping and native adaptations.
139
+ - [`docs/COVERAGE.md`](https://github.com/xoroh/axis/blob/main/docs/COVERAGE.md) — full component matrix across all 43 components.
126
140
 
127
141
  ## Compatibility
128
142
 
129
- - Declared supported: `react-native >=0.86 <0.89`, React 19, Expo 57
130
- host (peer ranges + D-STACK).
131
- - Exercised by automation: jest + RN preset; shipped-artifact bundle
132
- export on the Expo 57 host. Untested versions inside the range are
133
- untested — the range is policy, not proof.
134
- - Not performed: emulator, simulator, physical-device, or
135
- screen-reader validation.
143
+ - React >= 18
144
+ - React Native >= 0.86 < 0.89 (New Architecture / bridgeless compatible)
145
+ - Works seamlessly across iOS, Android, and React Native Web.
package/package.json CHANGED
@@ -1,12 +1,27 @@
1
1
  {
2
2
  "name": "@xoroh/axis",
3
- "version": "0.1.0",
4
- "description": "Design-system-neutral, native-first behavior and interaction primitives for React Native.",
3
+ "version": "0.1.1",
4
+ "description": "Unstyled, accessible UI components and native interaction primitives for React Native.",
5
5
  "keywords": [
6
6
  "react-native",
7
+ "reactjs",
8
+ "react-native-web",
7
9
  "primitives",
10
+ "unstyled",
11
+ "unstyled-components",
12
+ "headless",
8
13
  "accessibility",
9
- "unstyled"
14
+ "a11y",
15
+ "aria",
16
+ "ui-components",
17
+ "components",
18
+ "mobile",
19
+ "ios",
20
+ "android",
21
+ "cross-platform",
22
+ "design-system",
23
+ "base-ui",
24
+ "radix-ui"
10
25
  ],
11
26
  "license": "MIT",
12
27
  "author": "Xoroh",
@@ -15,7 +30,7 @@
15
30
  "url": "git+https://github.com/xoroh/axis.git",
16
31
  "directory": "packages/axis"
17
32
  },
18
- "homepage": "https://github.com/xoroh/axis",
33
+ "homepage": "https://axis.xoroh.org",
19
34
  "bugs": "https://github.com/xoroh/axis/issues",
20
35
  "engines": {
21
36
  "node": ">=20.19"