Skip to content

Commit c2f4458

Browse files
committed
style: format with oxfmt
1 parent ffdfa62 commit c2f4458

193 files changed

Lines changed: 4176 additions & 1081 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.ladle/components.tsx‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,20 @@ import "../src/styles.css";
1111
// colour.
1212
const Provider: GlobalProvider = ({ globalState, children }) => {
1313
useEffect(() => {
14-
const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
15-
const isDark = globalState.theme === "dark" || (globalState.theme === "auto" && prefersDark);
14+
const prefersDark = window.matchMedia(
15+
"(prefers-color-scheme: dark)",
16+
).matches;
17+
const isDark =
18+
globalState.theme === "dark" ||
19+
(globalState.theme === "auto" && prefersDark);
1620
document.documentElement.classList.toggle("dark", isDark);
1721
// theme.css now follows the OS when neither class is set, so "light" must
1822
// be pinned explicitly — removing `.dark` alone still renders dark on a
1923
// dark-OS dev box.
20-
document.documentElement.classList.toggle("light", globalState.theme === "light");
24+
document.documentElement.classList.toggle(
25+
"light",
26+
globalState.theme === "light",
27+
);
2128
}, [globalState.theme]);
2229

2330
return children;

‎ARCHITECTURE.md‎

Lines changed: 44 additions & 42 deletions
Large diffs are not rendered by default.

‎CONTRIBUTING.md‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Two things follow:
4747

4848
- **Change tokens in `src/theme.css`, then run `bun run build`.** Editing `dist/` changes
4949
nothing — it is generated output and is gitignored.
50-
- **Do not add hex pairs to the test.** The pairs are derived from token *names*. If a
50+
- **Do not add hex pairs to the test.** The pairs are derived from token _names_. If a
5151
token you added is not covered, the fix is a naming rule in `checksFor`, not a
5252
hardcoded pair.
5353

@@ -63,7 +63,7 @@ secret is a guard nobody can comply with.
6363

6464
1. **No `@workbench/*`.** A published file that imports an unpublished scope is
6565
uninstallable for everyone outside the project that defines it, and the failure lands
66-
in the *consumer's* install, where they cannot fix it.
66+
in the _consumer's_ install, where they cannot fix it.
6767
2. **Nothing reachable from the root barrel imports an optional peer.** Re-exporting a
6868
module that statically imports an optional peer makes that peer mandatory for every
6969
root import, so such a module must be kept out of the barrel and given its own `exports` entry.
@@ -82,7 +82,7 @@ around it.
8282
2. If it is public API, add `export * from "./<dir>/<name>.js";` to `src/index.ts`.
8383
Machinery stays unlisted: keeping something internal is cheap; taking an export back
8484
after it ships is not.
85-
3. If it is public but statically imports an *optional* peer, leave it out of
85+
3. If it is public but statically imports an _optional_ peer, leave it out of
8686
`src/index.ts` and add a `./<dir>/<name>` entry to `exports` in `package.json` instead.
8787
`dep-guard` fails if it reaches the barrel.
8888
4. If a `ui/` or `blocks/` module calls a hook, creates a context, defines an inline
@@ -167,7 +167,7 @@ not a follow-up.
167167
accessible name; an icon-only button needs `aria-label`.
168168
- **Colour is never the only channel.** Anything encoded in colour is encoded a second way
169169
too — a shape, an icon, a dash pattern, a label. Charts are the sharp case: the
170-
palette's dark-mode separation is compliant only *because* every chart ships a legend,
170+
palette's dark-mode separation is compliant only _because_ every chart ships a legend,
171171
direct labels and a data table.
172172
- Respect `prefers-reduced-motion` for anything that animates.
173173

@@ -181,12 +181,12 @@ Check your item in both modes and at 200% zoom before opening a change.
181181
major version.
182182
- **The minimum that works.** No wrapper that only forwards props, no config indirection,
183183
no speculative extension point. No CLI, no component generator, no docs site.
184-
- Comments explain *why*. The code already says what.
184+
- Comments explain _why_. The code already says what.
185185

186186
## Pull requests
187187

188188
- Keep commits focused, and keep the diff to the change you are describing.
189-
- Explain *why* in the commit message; the code already says what.
189+
- Explain _why_ in the commit message; the code already says what.
190190
- Run the gates locally and say so in the pull request: `dep-guard`, `typecheck`, `lint`,
191191
and `build` including the contrast gate. Nothing runs them for you yet.
192192
- Contributions are accepted under the repository's LGPL-2.1-only licence.

‎IMPLEMENTATION.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ Why the library exists lives in [PRODUCT.md](./PRODUCT.md).
2424

2525
Development uses **bun**. `bun run build` is three steps, joined by `&&`:
2626

27-
| Step | Tool | Output |
28-
| --- | --- | --- |
29-
| `build:js` | `tsc -p tsconfig.build.json` | `dist/**/*.js` and `dist/**/*.d.ts`, one per source file |
30-
| `build:css` | Tailwind v4 CLI | `dist/styles.css`, plus `dist/theme.css` copied from source |
27+
| Step | Tool | Output |
28+
| ----------- | ---------------------------- | ----------------------------------------------------------- |
29+
| `build:js` | `tsc -p tsconfig.build.json` | `dist/**/*.js` and `dist/**/*.d.ts`, one per source file |
30+
| `build:css` | Tailwind v4 CLI | `dist/styles.css`, plus `dist/theme.css` copied from source |
3131

3232
Source imports are relative and carry `.js` extensions. There is no path
3333
alias. `prepack` runs the build. CI runs `contrast-test` (reads `dist/styles.css`)

‎PRODUCT.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ It is not a design-system starter, not a CLI, and not a template app.
2020
## What a host can do
2121

2222
- Import from the root (`@corbits/react-ui`) and bundle only what they used.
23-
- Render collection surfaces against *their* data. Components never fetch.
23+
- Render collection surfaces against _their_ data. Components never fetch.
2424
Data arrives as props. Pieces that take no collection need no extra
2525
host wiring.
2626
- Style with a single prebuilt sheet (`@corbits/react-ui/styles.css`) and no

‎SECURITY.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ Defects in the components this package ships:
3939
- credentials, tokens, internal hostnames or real data in a shipped file or a
4040
fixture;
4141
- a declared dependency the package does not actually need, an undeclared one it
42-
does, or anything that runs at install time — the package has no install scripts,
43-
and adding one would be a supply-chain change.
42+
does, or anything that runs at install time — the package has no install scripts,
43+
and adding one would be a supply-chain change.
4444

4545
## What is not
4646

4747
- **Authentication and authorization.** This package ships no auth. The `login` and
48-
`access-notice` blocks are *presentation*: they render a form and a message. What
48+
`access-notice` blocks are _presentation_: they render a form and a message. What
4949
a submission does, whether a session is valid, and who may see a route are the
5050
host's, and a host that trusts a client-side check owns that decision.
5151
- **Fetching, caching and transport.** Components never fetch. A `DataPort`

‎package.json‎

Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,56 @@
22
"name": "@corbits/react-ui",
33
"version": "0.2.0",
44
"description": "React components for agent and workflow surfaces.",
5-
"author": "Sawyer Cutler <sawyer@dirtroad.dev>",
6-
"license": "LGPL-2.1-only",
7-
"engines": {
8-
"node": ">=24",
9-
"bun": ">=1.2.0"
10-
},
11-
"type": "module",
12-
"packageManager": "bun@1.4.0",
13-
"sideEffects": [
14-
"**/*.css"
15-
],
165
"homepage": "https://github.com/corbitsdev/react-ui",
6+
"bugs": {
7+
"url": "https://github.com/corbitsdev/react-ui/issues"
8+
},
9+
"license": "LGPL-2.1-only",
10+
"author": "Sawyer Cutler <sawyer@dirtroad.dev>",
1711
"repository": {
1812
"type": "git",
1913
"url": "git+https://github.com/corbitsdev/react-ui.git"
2014
},
21-
"bugs": {
22-
"url": "https://github.com/corbitsdev/react-ui/issues"
23-
},
2415
"files": [
2516
"dist"
2617
],
18+
"type": "module",
19+
"sideEffects": [
20+
"**/*.css"
21+
],
22+
"exports": {
23+
".": {
24+
"types": "./dist/index.d.ts",
25+
"default": "./dist/index.js"
26+
},
27+
"./ui/command-palette": {
28+
"types": "./dist/ui/command-palette.d.ts",
29+
"default": "./dist/ui/command-palette.js"
30+
},
31+
"./ui/dialog": {
32+
"types": "./dist/ui/dialog.d.ts",
33+
"default": "./dist/ui/dialog.js"
34+
},
35+
"./ui/menu": {
36+
"types": "./dist/ui/menu.d.ts",
37+
"default": "./dist/ui/menu.js"
38+
},
39+
"./ui/mic-permission-dialog": {
40+
"types": "./dist/ui/mic-permission-dialog.d.ts",
41+
"default": "./dist/ui/mic-permission-dialog.js"
42+
},
43+
"./ui/toast": {
44+
"types": "./dist/ui/toast.d.ts",
45+
"default": "./dist/ui/toast.js"
46+
},
47+
"./ui/tooltip": {
48+
"types": "./dist/ui/tooltip.d.ts",
49+
"default": "./dist/ui/tooltip.js"
50+
},
51+
"./styles.css": "./dist/styles.css",
52+
"./theme.css": "./dist/theme.css",
53+
"./package.json": "./package.json"
54+
},
2755
"publishConfig": {
2856
"access": "public"
2957
},
@@ -48,30 +76,6 @@
4876
"clsx": "^2.1.1",
4977
"tailwind-merge": "^3.3.1"
5078
},
51-
"peerDependencies": {
52-
"@radix-ui/react-dialog": "^1.1.15",
53-
"@radix-ui/react-dropdown-menu": "^2.1.16",
54-
"@radix-ui/react-slot": "^1.2.3",
55-
"@radix-ui/react-tooltip": "^1.2.8",
56-
"lucide-react": "^0.545.0 || ^1.0.0",
57-
"react": "^18.2.0 || ^19.0.0",
58-
"react-dom": "^18.2.0 || ^19.0.0",
59-
"sonner": "^2.0.7"
60-
},
61-
"peerDependenciesMeta": {
62-
"@radix-ui/react-dialog": {
63-
"optional": true
64-
},
65-
"@radix-ui/react-dropdown-menu": {
66-
"optional": true
67-
},
68-
"@radix-ui/react-tooltip": {
69-
"optional": true
70-
},
71-
"sonner": {
72-
"optional": true
73-
}
74-
},
7579
"devDependencies": {
7680
"@happy-dom/global-registrator": "^20.11.2",
7781
"@ladle/react": "^5.1.1",
@@ -94,37 +98,33 @@
9498
"tailwindcss": "^4.3.3",
9599
"typescript": "^5.9.3"
96100
},
97-
"exports": {
98-
".": {
99-
"types": "./dist/index.d.ts",
100-
"default": "./dist/index.js"
101-
},
102-
"./ui/command-palette": {
103-
"types": "./dist/ui/command-palette.d.ts",
104-
"default": "./dist/ui/command-palette.js"
105-
},
106-
"./ui/dialog": {
107-
"types": "./dist/ui/dialog.d.ts",
108-
"default": "./dist/ui/dialog.js"
109-
},
110-
"./ui/menu": {
111-
"types": "./dist/ui/menu.d.ts",
112-
"default": "./dist/ui/menu.js"
113-
},
114-
"./ui/mic-permission-dialog": {
115-
"types": "./dist/ui/mic-permission-dialog.d.ts",
116-
"default": "./dist/ui/mic-permission-dialog.js"
101+
"peerDependencies": {
102+
"@radix-ui/react-dialog": "^1.1.15",
103+
"@radix-ui/react-dropdown-menu": "^2.1.16",
104+
"@radix-ui/react-slot": "^1.2.3",
105+
"@radix-ui/react-tooltip": "^1.2.8",
106+
"lucide-react": "^0.545.0 || ^1.0.0",
107+
"react": "^18.2.0 || ^19.0.0",
108+
"react-dom": "^18.2.0 || ^19.0.0",
109+
"sonner": "^2.0.7"
110+
},
111+
"peerDependenciesMeta": {
112+
"@radix-ui/react-dialog": {
113+
"optional": true
117114
},
118-
"./ui/toast": {
119-
"types": "./dist/ui/toast.d.ts",
120-
"default": "./dist/ui/toast.js"
115+
"@radix-ui/react-dropdown-menu": {
116+
"optional": true
121117
},
122-
"./ui/tooltip": {
123-
"types": "./dist/ui/tooltip.d.ts",
124-
"default": "./dist/ui/tooltip.js"
118+
"@radix-ui/react-tooltip": {
119+
"optional": true
125120
},
126-
"./styles.css": "./dist/styles.css",
127-
"./theme.css": "./dist/theme.css",
128-
"./package.json": "./package.json"
129-
}
121+
"sonner": {
122+
"optional": true
123+
}
124+
},
125+
"engines": {
126+
"bun": ">=1.2.0",
127+
"node": ">=24"
128+
},
129+
"packageManager": "bun@1.4.0"
130130
}

0 commit comments

Comments
 (0)