@phreshos/react-ui 0.1.13 → 0.1.14

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 +61 -70
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -1,87 +1,78 @@
1
1
  # `@phreshos/react-ui`
2
2
 
3
- Environment-neutral React components and visual interpretation for PhreshOS.
4
- The package depends on React and Core contracts, not on either execution SDK.
3
+ Environment-neutral React components and the visual language of PhreshOS.
5
4
 
6
- ## Appearance composition
5
+ React UI interprets Core Appearance and Theme contracts. It does not depend on a
6
+ Client or Server runtime and does not own authoritative application state.
7
7
 
8
- React UI receives complete unresolved `Appearance` plus one effective
9
- `"light" | "dark"` Theme:
8
+ ## Installation
9
+
10
+ | Package manager | Command |
11
+ | --- | --- |
12
+ | npm | `npm install @phreshos/react-ui` |
13
+ | pnpm | `pnpm add @phreshos/react-ui` |
14
+ | Bun | `bun add @phreshos/react-ui` |
15
+ | Yarn | `yarn add @phreshos/react-ui` |
16
+
17
+ `@phreshos/core`, React, and React DOM are peer dependencies.
18
+
19
+ ## Appearance
10
20
 
11
21
  ```tsx
12
22
  import { standardAppearance } from "@phreshos/core"
13
- import { AppearanceProvider, Button, Surface } from "@phreshos/react-ui"
14
-
15
- export function Example() {
16
- return <AppearanceProvider appearance={standardAppearance} theme="light">
17
- <Surface><Button>Continue</Button></Surface>
18
- </AppearanceProvider>
19
- }
23
+ import {
24
+ AppearanceProvider,
25
+ Button,
26
+ Surface,
27
+ } from "@phreshos/react-ui"
28
+
29
+ <AppearanceProvider appearance={standardAppearance} theme="light">
30
+ <Surface>
31
+ <Button>Continue</Button>
32
+ </Surface>
33
+ </AppearanceProvider>
20
34
  ```
21
35
 
22
- `useAppearance()` returns the unresolved value. `useTheme()` returns only the
23
- effective mode. `useResolveTheme(themed)` resolves one property at the point
24
- where it is consumed. Components follow the same rule, so the provider never
25
- collapses Appearance into a second retained object.
36
+ `AppearanceProvider` provides the unresolved Appearance and one effective
37
+ `"light" | "dark"` Theme. `useAppearance()` reads the unresolved value,
38
+ `useTheme()` reads the effective mode, and `useResolveTheme()` resolves one
39
+ themed property where it is consumed.
26
40
 
27
- An application using the Client SDK composes the packages explicitly:
41
+ The provider also applies the shared document scrollbar treatment without
42
+ adding a rendered container.
28
43
 
29
- ```tsx
30
- import { useDesktopPreferences, useSystemAppearance } from "@phreshos/react"
44
+ ## Components
31
45
 
32
- const appearance = useSystemAppearance()
33
- const { theme } = useDesktopPreferences()
46
+ The package owns the reusable visual primitives used across the desktop and
47
+ official Programs:
34
48
 
35
- return <AppearanceProvider appearance={appearance} theme={theme}>
36
- {children}
37
- </AppearanceProvider>
49
+ - `Surface` and `SurfaceMaterial`
50
+ - `Button`
51
+ - `Flex` and `Grid`
52
+ - spacing, scale, radius, color, and icon utilities
53
+
54
+ These primitives form one visual language. Desktop and Program Views compose
55
+ them rather than reimplementing their material or layout behavior.
56
+
57
+ ## Development
58
+
59
+ ```sh
60
+ bun install --frozen-lockfile
61
+ bun run verify
38
62
  ```
39
63
 
40
- Document color-scheme negotiation belongs to the System iframe and the Client
41
- HTML document, not to a visual component or React hook.
42
-
43
- `AppearanceProvider` also owns the native scrollbars in its document. It adds
44
- no rendered container: one document stylesheet styles a six-pixel rounded
45
- thumb from Appearance foreground and radius, leaves the track transparent, and
46
- gives its container five pixels of transparent padding. With a precise
47
- pointer, the thumb is transparent outside its scrollable area, uses foreground
48
- at 10% inside it, and rises to 20% directly under the pointer. Touch documents
49
- retain the 10% thumb. The standardized scrollbar API has no thumb-hover state,
50
- so its fallback stops at 10%. Standard and WebKit rules are mutually exclusive
51
- so the standard thin width cannot override the padded geometry. WebKit hover
52
- also invalidates the scrollbar style to ensure Safari repaints each state.
53
-
54
- ## Levels
55
-
56
- `useScale(value)` and `useColor(value)` derive semantic UI levels from one
57
- concrete value. They do not select an Appearance property or read an
58
- environment. Components resolve the property they need first and then derive
59
- their local level.
60
-
61
- Layout primitives accept native values without a provider. Semantic gaps and
62
- radii require Appearance because their concrete source is `spacing` or
63
- `radius`.
64
-
65
- ## Surface
66
-
67
- `Surface` is the shared visual material. It accepts native `div` properties
68
- plus local overrides for grain, grain amount, backdrop blur, opacity,
69
- distortion, waves, ripples, saturation, and brightness. Omitted controls derive
70
- from the resolved Appearance. A zero-valued optional effect is omitted from the
71
- rendered material so disabled work costs nothing.
72
-
73
- Each Surface returns one plain geometry and content container. Its existing SVG
74
- material paints both the fill and its material-derived border; no separate
75
- border element is rendered. Backdrop refraction and frost remain separate
76
- compositor layers. Radius and foreground resolve from Appearance; elevation
77
- stays with the surrounding layout.
64
+ `verify` checks the contracts, tests the components, builds the package, and
65
+ validates its public artifact.
78
66
 
79
- ## Components
67
+ ## Repository boundary
68
+
69
+ This repository owns visual interpretation and reusable React components. Core
70
+ owns Appearance contracts, React owns runtime-neutral state adaptation, and
71
+ applications own composition.
72
+
73
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for the repository workflow and
74
+ [SECURITY.md](SECURITY.md) for private vulnerability reporting.
75
+
76
+ ## License
80
77
 
81
- - `Surface`: shared material container.
82
- - `Button`: normalized React Aria action with pending and disabled states.
83
- - `Flex` and `Grid`: small layout primitives that preserve native props.
84
- - `AppearanceProvider`, `useAppearance`, `useTheme`, `useResolveTheme`:
85
- environment-neutral appearance composition.
86
- - `useScale`, `useColor`, `resolveSpacing`, `resolveRadius`: explicit visual
87
- derivation helpers.
78
+ Licensed under the [MIT License](LICENSE). Copyright © 2026 Zohayr SLILEH.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phreshos/react-ui",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
4
4
  "description": "React components for coherent PhreshOS Program interfaces.",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -52,7 +52,7 @@
52
52
  "prepack": "node --run test && node --run build"
53
53
  },
54
54
  "peerDependencies": {
55
- "@phreshos/core": "^0.1.22",
55
+ "@phreshos/core": "^0.1.31",
56
56
  "react": "^19.2.0",
57
57
  "react-dom": "^19.2.0"
58
58
  },
@@ -61,7 +61,7 @@
61
61
  },
62
62
  "devDependencies": {
63
63
  "@base-ui/react": "^1.7.0",
64
- "@phreshos/core": "^0.1.28",
64
+ "@phreshos/core": "^0.1.31",
65
65
  "@testing-library/dom": "^10.4.1",
66
66
  "@testing-library/react": "^16.3.0",
67
67
  "@testing-library/user-event": "^14.6.1",