Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

# Generated from the committed Impression package; verify snapshot hashes.
packages/ui/
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Repository instructions

This package-only repository owns the Notenv and CTX9 application design system and shared browser identity protocol. Shared packages are Apache-2.0 and new releases target public npm; publication readiness and source visibility are recorded in `docs/public-distribution.md`.
This package-only repository publishes the Notenv and CTX9 application design system and owns the shared browser identity protocol. UI source is edited in Impression at `packages/ui`; this repository retains reviewed public release snapshots. Shared packages are Apache-2.0 and new releases target public npm; publication readiness and source visibility are recorded in `docs/public-distribution.md`.

`@ctx9/identity` reuses the Better Auth authority with application-owned PostgreSQL, enrollment/recovery authorization, credential-event persistence and membership resolution. Keep private Platform provisioning and installation data in its adapter. Read `docs/identity-authority.md` before changing that boundary.

- Always work on master unless instructed not to.
- Read `docs/style-guide.md`, `docs/component-inventory.md`, `docs/error-handling.md`, `docs/source-provenance.md`, and `docs/package-release.md` before changing public exports.
- Shared internal UI uses Impression's semantic light and dark themes. CTX9 applications may default to dark, but they do not own a separate CTX9 theme.
- Impression internal components and style policy are the canonical source for `@ctx9/ui`. Never import Impression at runtime or copy Impression public-marketing and product-specific components.
- Edit `@ctx9/ui` in Impression `packages/ui`. Prepare a snapshot from an exact committed revision with Impression `pnpm ui:export`, then review it here. Never hand-edit snapshot components, import Impression at runtime, or copy public-marketing or product-specific components.
- Non-trivial UI work requires Matt's explicit direction before changing real components. The phase 3 shared UI consolidation plan is that direction for the Impression-aligned replacement.
- Keep `@ctx9/web-auth` framework-neutral. Persistence stays behind injected interfaces; applications keep separate clients, databases, cookies, and authorization policy.
- Never add parent-domain cookies, browser bearer-token storage, callback transaction material in logs, or shared session persistence.
Expand Down
28 changes: 27 additions & 1 deletion docs/package-release.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# Package release and consumption

## Preparing UI snapshots

Impression `packages/ui` is the authoritative editable UI source. Its workspace
consumer needs no public release. Other applications retain exact npm versions
and use those versions in development and production.

After committing UI changes in Impression, run:

```sh
pnpm ui:export --ref <impression-commit> --out <new-staging-directory> --version <release-version>
```

Review the staged allowlisted UI files in a ctx9-web release branch. The exporter
records the source revision and SHA-256 file hashes in `snapshot.json`; it removes
the local private flag, selects the public version and adds the archive build
hook. Replace the UI snapshot as a whole, including removal of retired files.
Do not copy private application files, history, credentials or build artifacts.
Do not edit generated UI components here or automatically sync every app push.

Keep all three public package versions aligned under the existing release policy.
Run complete checks and isolated archive installation. Matt must confirm before
publishing through the protected immutable tag workflow below. A snapshot import
or package release does not deploy applications. Identity and web-auth continue
to be developed here. The retired sibling-development helper requires a breaking
public release when its removal is first published; do not reuse version 10.1.0.

## 10.1.0 Button hover and chat icon

Every Button variant exposes `group/btn`, including native buttons, `href`
Expand Down Expand Up @@ -82,7 +108,7 @@ three packages match the retained CI bytes; Cosign verifies their provenance
against the exact workflow, tag and source commit. See the
[read-back receipt](evidence/public-npm-9.3.1-2026-10-21.json).

GitHub `ContextNine/ctx9-web` is the canonical source. New releases beginning with the public-distribution candidate 9.0.1 target public npm through `.github/workflows/publish.yml`. GitLab continues to check mirrored refs and retains historical private releases. It does not publish new versions. See [public distribution](public-distribution.md) for publication requirements and current acceptance state.
GitHub `ContextNine/ctx9-web` is the public release source; UI implementation is owned by Impression `packages/ui`. New releases beginning with the public-distribution candidate 9.0.1 target public npm through `.github/workflows/publish.yml`. GitLab continues to check mirrored refs and retains historical private releases. It does not publish new versions. See [public distribution](public-distribution.md) for publication requirements and current acceptance state.

The historical private-release procedures and evidence below describe versions through 9.0.0. They are not the publication procedure for new versions.

Expand Down
4 changes: 4 additions & 0 deletions docs/source-provenance.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Reference repository: Impression

From the workspace migration onward, editable UI source lives in Impression
`packages/ui`. Future imports include `packages/ui/snapshot.json` with the exact
source commit and file hashes. Historical provenance below remains retained.

NewChatIcon moves Impression `f58e456c`'s Lucide square pen into the shared
package. The 2.5 stroke, visible overflow, full-contrast hover colour and
reduced-motion colour-only behavior are retained. Matt's November 23 request
Expand Down
3 changes: 3 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ export default defineConfig(
"**/coverage/**",
"**/*.d.ts",
"**/tailwind.config.cjs",
"packages/ui/*config.js",
"packages/ui/vitest.config.ts",
"packages/ui/scripts/**",
],
},
eslint.configs.recommended,
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"styles:check": "tsx scripts/check-styles.ts",
"test": "vitest run",
"typecheck": "pnpm --recursive typecheck",
"check": "pnpm format:check && pnpm lint && pnpm typecheck && pnpm build && pnpm test && pnpm styles:check && pnpm packages:check && pnpm provenance:check && pnpm archives:check && pnpm install:check"
"check": "pnpm format:check && pnpm lint && pnpm typecheck && pnpm build && pnpm test && pnpm styles:check && pnpm packages:check && pnpm snapshot:check && pnpm provenance:check && pnpm archives:check && pnpm install:check",
"snapshot:check": "tsx scripts/check-ui-snapshot.ts"
},
"devDependencies": {
"@eslint/js": "9.39.1",
Expand Down
15 changes: 4 additions & 11 deletions packages/ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,12 @@

Impression-aligned controls and application compositions for internal products, with one light theme and one dark theme. Import `@ctx9/ui/styles.css` exactly once in the application root.

Licensed under Apache-2.0, published on public npm. See `NOTICE`, `THIRD_PARTY_NOTICES.md` and `dist/fonts/licenses/` for bundled third-party attribution. Source and release acceptance are at [ContextNine/ctx9-web](https://github.com/ContextNine/ctx9-web).
Licensed under Apache-2.0, published on public npm. See `NOTICE`, `THIRD_PARTY_NOTICES.md` and `dist/fonts/licenses/` for bundled third-party attribution. Editable source lives in Impression at `packages/ui`. Public release snapshots and release acceptance are at [ContextNine/ctx9-web](https://github.com/ContextNine/ctx9-web).

```tsx
import "@ctx9/ui/styles.css";
import {
ApplicationLayout,
AuthShell,
Button,
DataTable,
Input,
NavigationProvider,
NewChatIcon,
} from "@ctx9/ui";
import '@ctx9/ui/styles.css';

import { ApplicationLayout, AuthShell, Button, DataTable, Input, NavigationProvider, NewChatIcon } from '@ctx9/ui';
```

The package owns:
Expand Down
7 changes: 7 additions & 0 deletions packages/ui/SOURCE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Source

Imported from ContextNine/ctx9-web, `packages/ui`, commit
`b10204c5dfcb826afe08a5c1cbc2544fcb7d2fd8`, version 10.1.0.

This directory is now the authoritative editable UI source. Public release snapshots
are prepared explicitly in ctx9-web. Preserve the licenses and notices.
26 changes: 26 additions & 0 deletions packages/ui/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import eslint from '@eslint/js';
import { defineConfig } from 'eslint/config';
import tseslint from 'typescript-eslint';

export default defineConfig(
{
ignores: ['**/dist/**', '**/.ctx9-ui-dev/**', '**/coverage/**', '**/*.d.ts', '**/tailwind.config.cjs'],
},
eslint.configs.recommended,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
{
languageOptions: {
parserOptions: {
projectService: {
allowDefaultProject: ['eslint.config.js', 'postcss.config.js', 'vitest.config.ts', 'scripts/*.mjs'],
},
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/no-explicit-any': 'error',
},
},
);
77 changes: 43 additions & 34 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,17 @@
"name": "@ctx9/ui",
"version": "10.1.0",
"description": "Shared Impression and CTX9 internal application UI",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "git+https://github.com/ContextNine/ctx9-web.git",
"directory": "packages/ui"
},
"type": "module",
"license": "Apache-2.0",
"sideEffects": [
"./dist/styles.css"
],
"files": [
"dist",
"README.md",
"LICENSE",
"NOTICE",
"THIRD_PARTY_NOTICES.md"
],
"type": "module",
"exports": {
"./dev": {
"types": "./dist/dev.d.ts",
"default": "./dist/dev.js"
},
"./style-policy": {
"types": "./dist/style-policy.d.ts",
"default": "./dist/style-policy.js"
Expand All @@ -35,27 +24,33 @@
"./styles.css": "./dist/styles.css",
"./icon.svg": "./dist/assets/icon.svg"
},
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
},
"bin": {
"ctx9-ui-dev": "./dist/dev-cli.js",
"ctx9-ui-style-check": "./dist/style-policy-cli.js"
},
"files": [
"dist",
"README.md",
"LICENSE",
"NOTICE",
"THIRD_PARTY_NOTICES.md"
],
"scripts": {
"build": "pnpm clean && tsc -p tsconfig.build.json && tailwindcss -c tailwind.config.cjs -i src/styles.css -o dist/styles.css --postcss ../../postcss.config.js --no-autoprefixer --minify && mkdir -p dist/assets dist/fonts && cp src/assets/icon.svg dist/assets/icon.svg && cp -R src/fonts/. dist/fonts/",
"build": "tsc -p tsconfig.build.json && pnpm run build:css && node scripts/copy-assets.mjs",
"build:css": "tailwindcss -c tailwind.config.cjs -i src/styles.css -o dist/styles.css --postcss postcss.config.js --no-autoprefixer --minify",
"check": "pnpm typecheck && pnpm lint && pnpm build && pnpm test:unit && node scripts/check-package.mjs",
"clean": "rm -rf dist",
"prepack": "pnpm build",
"typecheck": "tsc -p tsconfig.json --noEmit"
"format": "prettier --check .",
"lint": "eslint src",
"test:unit": "vitest run",
"typecheck": "tsc -p tsconfig.json --noEmit",
"prepack": "pnpm clean && pnpm build"
},
"dependencies": {
"typescript": "5.9.3",
"@radix-ui/react-alert-dialog": "1.1.15",
"@radix-ui/react-avatar": "1.1.2",
"@radix-ui/react-checkbox": "1.3.3",
"@radix-ui/react-collapsible": "1.1.12",
"@radix-ui/react-context-menu": "2.2.16",
"@radix-ui/react-checkbox": "1.3.3",
"@radix-ui/react-dialog": "1.1.15",
"@radix-ui/react-dropdown-menu": "2.1.16",
"@radix-ui/react-label": "2.1.8",
Expand All @@ -74,33 +69,47 @@
"cmdk": "1.1.1",
"date-fns": "4.1.0",
"framer-motion": "12.23.24",
"lucide-react": "0.546.0",
"motion-dom": "12.23.23",
"motion-utils": "12.23.6",
"lucide-react": "0.546.0",
"react-day-picker": "9.11.1",
"radix-ui": "1.4.3",
"react-colorful": "5.6.1",
"react-day-picker": "9.11.1",
"react-hook-form": "7.66.1",
"react-resizable-panels": "3.0.6",
"radix-ui": "1.4.3",
"recharts": "3.8.1",
"sonner": "1.7.4",
"tailwind-merge": "3.4.0"
},
"engines": {
"node": "^22.16.0 || ^24.21.0 || ^26.11.1"
},
"peerDependencies": {
"react": "19.1.0",
"react-dom": "19.1.0"
"tailwind-merge": "3.4.0",
"typescript": "5.9.3"
},
"devDependencies": {
"@eslint/js": "9.39.1",
"@testing-library/react": "16.2.0",
"@testing-library/user-event": "14.6.4",
"@types/node": "22.19.1",
"@types/react": "19.1.17",
"@types/react-dom": "19.1.11",
"autoprefixer": "10.4.22",
"eslint": "9.39.1",
"jsdom": "30.0.1",
"postcss": "8.5.18",
"react": "19.1.0",
"react-dom": "19.1.0",
"tailwindcss": "3.4.17",
"tailwindcss-animate": "1.0.7",
"typescript-eslint": "8.67.0",
"vitest": "4.1.10",
"vitest-axe": "0.1.0"
},
"peerDependencies": {
"react": "19.1.0",
"react-dom": "19.1.0"
},
"engines": {
"node": "^22.16.0 || ^24.21.0 || ^26.11.1"
},
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
}
}
9 changes: 9 additions & 0 deletions packages/ui/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {
// Impression's Next 15 CSS targets, not the CLI's bundled prefixer defaults.
overrideBrowserslist: ['chrome 64', 'edge 79', 'firefox 67', 'opera 51', 'safari 12'],
},
},
};
27 changes: 27 additions & 0 deletions packages/ui/scripts/check-package.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import assert from 'node:assert/strict';
import { createHash } from 'node:crypto';
import { readFile } from 'node:fs/promises';

const fonts = {
'geist-sans-variable.woff2': '46525b05bbf4527d263f8624ca7024c7d0dce3c64430267d30c31c6dd3821e4d',
'inter-normal-variable.ttf': '29160a80ff49ddcab2c97711247e08b1fab27a484a329ce8b813d820dc559031',
'jetbrains-mono-latin-variable.woff2': '18be452724bfdc236c074ca94a249a7f41a86752c7d04ab258ce9ed5651f6a7e',
};
for (const [name, expected] of Object.entries(fonts)) {
assert.equal(
createHash('sha256')
.update(await readFile(`dist/fonts/${name}`))
.digest('hex'),
expected,
name,
);
}
for (const name of ['geist', 'inter', 'jetbrains-mono']) {
assert.match(await readFile(`dist/fonts/licenses/${name}-ofl.txt`, 'utf8'), /SIL OPEN FONT LICENSE/);
}
for (const name of ['LICENSE', 'NOTICE', 'THIRD_PARTY_NOTICES.md', 'dist/assets/icon.svg', 'dist/styles.css']) {
assert.ok((await readFile(name)).length, name);
}
const entry = await readFile('dist/button.js', 'utf8');
assert.match(entry, /["']use client["']/);
console.log('UI package assets, licenses and client entry passed');
5 changes: 5 additions & 0 deletions packages/ui/scripts/copy-assets.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { cp, mkdir } from 'node:fs/promises';

await mkdir('dist/assets', { recursive: true });
await cp('src/assets', 'dist/assets', { recursive: true });
await cp('src/fonts', 'dist/fonts', { recursive: true });
Loading