aeon-ui-engine 1.0.1 → 1.0.3
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/CHANGELOG.md +51 -0
- package/CONSUMER.md +86 -0
- package/INTEGRATION.md +2 -0
- package/README.md +15 -4
- package/package.json +17 -1
- package/packages/core/dist/index.d.ts +257 -0
- package/packages/core/dist/index.js +378 -0
- package/packages/core/node_modules/.bin/esbuild +21 -0
- package/packages/core/node_modules/.bin/jiti +21 -0
- package/packages/core/node_modules/.bin/tsc +21 -0
- package/packages/core/node_modules/.bin/tsserver +21 -0
- package/packages/core/node_modules/.bin/tsup +21 -0
- package/packages/core/node_modules/.bin/tsup-node +21 -0
- package/packages/core/node_modules/.bin/tsx +21 -0
- package/packages/core/node_modules/.bin/vite +21 -0
- package/packages/core/node_modules/.bin/vitest +21 -0
- package/packages/core/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
- package/packages/geometry/dist/index.d.ts +50 -0
- package/packages/geometry/dist/index.js +88 -0
- package/packages/geometry/node_modules/.bin/esbuild +21 -0
- package/packages/geometry/node_modules/.bin/jiti +21 -0
- package/packages/geometry/node_modules/.bin/tsc +21 -0
- package/packages/geometry/node_modules/.bin/tsserver +21 -0
- package/packages/geometry/node_modules/.bin/tsup +21 -0
- package/packages/geometry/node_modules/.bin/tsup-node +21 -0
- package/packages/geometry/node_modules/.bin/tsx +21 -0
- package/packages/panda/src/recipes/button.ts +4 -4
- package/packages/panda/src/recipes/combobox.ts +1 -1
- package/packages/panda/src/recipes/select.ts +1 -1
- package/packages/panda/src/theme/tokens.ts +5 -0
- package/packages/panda/styled-system/styles.css +10 -6
- package/packages/panda/styled-system/tokens/index.mjs +32 -0
- package/packages/panda/styled-system/tokens/tokens.d.ts +2 -2
- package/packages/primitives/dist/chunk-5S4DIRL4.js +42 -0
- package/packages/primitives/dist/chunk-H4KOEPYC.js +52 -0
- package/packages/primitives/dist/chunk-HONROWUG.js +41 -0
- package/packages/primitives/dist/chunk-J6JHKMVM.js +90 -0
- package/packages/primitives/dist/chunk-JBAG5E6W.js +46 -0
- package/packages/primitives/dist/chunk-LVNCD5F2.js +43 -0
- package/packages/primitives/dist/chunk-PB3LFHXU.js +72 -0
- package/packages/primitives/dist/chunk-SZV6KGXN.js +49 -0
- package/packages/primitives/dist/chunk-WVICCOQH.js +56 -0
- package/packages/primitives/dist/chunk-ZMGRX64G.js +74 -0
- package/packages/primitives/dist/index.d.ts +11 -0
- package/packages/primitives/dist/index.js +60 -0
- package/packages/primitives/dist/machines/accordion.d.ts +34 -0
- package/packages/primitives/dist/machines/accordion.js +6 -0
- package/packages/primitives/dist/machines/async.d.ts +111 -0
- package/packages/primitives/dist/machines/async.js +12 -0
- package/packages/primitives/dist/machines/button.d.ts +45 -0
- package/packages/primitives/dist/machines/button.js +8 -0
- package/packages/primitives/dist/machines/dialog.d.ts +57 -0
- package/packages/primitives/dist/machines/dialog.js +6 -0
- package/packages/primitives/dist/machines/field.d.ts +72 -0
- package/packages/primitives/dist/machines/field.js +12 -0
- package/packages/primitives/dist/machines/popover.d.ts +54 -0
- package/packages/primitives/dist/machines/popover.js +6 -0
- package/packages/primitives/dist/machines/slider.d.ts +71 -0
- package/packages/primitives/dist/machines/slider.js +10 -0
- package/packages/primitives/dist/machines/tabs.d.ts +39 -0
- package/packages/primitives/dist/machines/tabs.js +6 -0
- package/packages/primitives/dist/machines/toast.d.ts +31 -0
- package/packages/primitives/dist/machines/toast.js +6 -0
- package/packages/primitives/dist/machines/toggle.d.ts +54 -0
- package/packages/primitives/dist/machines/toggle.js +6 -0
- package/packages/primitives/node_modules/.bin/jiti +21 -0
- package/packages/primitives/node_modules/.bin/tsc +21 -0
- package/packages/primitives/node_modules/.bin/tsserver +21 -0
- package/packages/primitives/node_modules/.bin/tsup +21 -0
- package/packages/primitives/node_modules/.bin/tsup-node +21 -0
- package/packages/primitives/node_modules/.bin/tsx +21 -0
- package/packages/primitives/node_modules/.bin/vitest +21 -0
- package/packages/primitives/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
- package/packages/react/dist/index.d.ts +564 -0
- package/packages/react/dist/index.js +3461 -0
- package/packages/react/node_modules/.bin/jiti +21 -0
- package/packages/react/node_modules/.bin/tsc +21 -0
- package/packages/react/node_modules/.bin/tsserver +21 -0
- package/packages/react/node_modules/.bin/tsup +21 -0
- package/packages/react/node_modules/.bin/tsup-node +21 -0
- package/packages/react/node_modules/.bin/tsx +21 -0
- package/packages/react/node_modules/.bin/vitest +21 -0
- package/packages/react/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
- package/packages/react-scene/dist/index.d.ts +121 -0
- package/packages/react-scene/dist/index.js +430 -0
- package/packages/react-scene/node_modules/.bin/jiti +21 -0
- package/packages/react-scene/node_modules/.bin/tsc +21 -0
- package/packages/react-scene/node_modules/.bin/tsserver +21 -0
- package/packages/react-scene/node_modules/.bin/tsup +21 -0
- package/packages/react-scene/node_modules/.bin/tsup-node +21 -0
- package/packages/react-scene/node_modules/.bin/tsx +21 -0
- package/packages/scene/dist/index.d.ts +46 -0
- package/packages/scene/dist/index.js +54 -0
- package/packages/scene/node_modules/.bin/jiti +21 -0
- package/packages/scene/node_modules/.bin/tsc +21 -0
- package/packages/scene/node_modules/.bin/tsserver +21 -0
- package/packages/scene/node_modules/.bin/tsup +21 -0
- package/packages/scene/node_modules/.bin/tsup-node +21 -0
- package/packages/scene/node_modules/.bin/tsx +21 -0
- package/packages/signal/dist/index.d.ts +54 -0
- package/packages/signal/dist/index.js +169 -0
- package/packages/signal/node_modules/.bin/jiti +21 -0
- package/packages/signal/node_modules/.bin/tsc +21 -0
- package/packages/signal/node_modules/.bin/tsserver +21 -0
- package/packages/signal/node_modules/.bin/tsup +21 -0
- package/packages/signal/node_modules/.bin/tsup-node +21 -0
- package/packages/signal/node_modules/.bin/tsx +21 -0
- package/packages/site/dist/index.d.ts +31 -0
- package/packages/site/dist/index.js +62 -0
- package/packages/site/node_modules/.bin/jiti +21 -0
- package/packages/site/node_modules/.bin/tsc +21 -0
- package/packages/site/node_modules/.bin/tsserver +21 -0
- package/packages/site/node_modules/.bin/tsup +21 -0
- package/packages/site/node_modules/.bin/tsup-node +21 -0
- package/packages/site/node_modules/.bin/tsx +21 -0
- package/packages/solid/dist/index.d.ts +30 -0
- package/packages/solid/dist/index.js +174 -0
- package/packages/solid/node_modules/.bin/jiti +21 -0
- package/packages/solid/node_modules/.bin/tsc +21 -0
- package/packages/solid/node_modules/.bin/tsserver +21 -0
- package/packages/solid/node_modules/.bin/tsup +21 -0
- package/packages/solid/node_modules/.bin/tsup-node +21 -0
- package/packages/solid/node_modules/.bin/tsx +21 -0
- package/packages/surface/dist/index.d.ts +8 -0
- package/packages/surface/dist/index.js +14 -0
- package/packages/surface/node_modules/.bin/jiti +21 -0
- package/packages/surface/node_modules/.bin/tsc +21 -0
- package/packages/surface/node_modules/.bin/tsserver +21 -0
- package/packages/surface/node_modules/.bin/tsup +21 -0
- package/packages/surface/node_modules/.bin/tsup-node +21 -0
- package/packages/surface/node_modules/.bin/tsx +21 -0
- package/packages/svelte/dist/index.d.ts +12 -0
- package/packages/svelte/dist/index.js +15 -0
- package/packages/svelte/node_modules/.bin/acorn +21 -0
- package/packages/svelte/node_modules/.bin/jiti +21 -0
- package/packages/svelte/node_modules/.bin/svelte-check +21 -0
- package/packages/svelte/node_modules/.bin/tsc +21 -0
- package/packages/svelte/node_modules/.bin/tsserver +21 -0
- package/packages/svelte/node_modules/.bin/tsup +21 -0
- package/packages/svelte/node_modules/.bin/tsup-node +21 -0
- package/packages/svelte/node_modules/.bin/tsx +21 -0
- package/packages/svelte/node_modules/.bin/vite +21 -0
- package/packages/ui/dist/index.d.ts +200 -0
- package/packages/ui/dist/index.js +429 -0
- package/packages/ui/node_modules/.bin/jiti +21 -0
- package/packages/ui/node_modules/.bin/tsc +21 -0
- package/packages/ui/node_modules/.bin/tsserver +21 -0
- package/packages/ui/node_modules/.bin/tsup +21 -0
- package/packages/ui/node_modules/.bin/tsup-node +21 -0
- package/packages/ui/node_modules/.bin/tsx +21 -0
- package/packages/ui/src/select.tsx +3 -4
- package/packages/vue/dist/index.d.ts +71 -0
- package/packages/vue/dist/index.js +193 -0
- package/packages/vue/node_modules/.bin/jiti +21 -0
- package/packages/vue/node_modules/.bin/tsc +21 -0
- package/packages/vue/node_modules/.bin/tsserver +21 -0
- package/packages/vue/node_modules/.bin/tsup +21 -0
- package/packages/vue/node_modules/.bin/tsup-node +21 -0
- package/packages/vue/node_modules/.bin/tsx +21 -0
- package/scripts/vite-aliases.mjs +125 -0
- package/.changeset/README.md +0 -23
- package/.changeset/combobox-and-changesets.md +0 -9
- package/.changeset/config.json +0 -30
- package/.changeset/framework-adapters.md +0 -12
- package/.changeset/scene-3d.md +0 -6
- package/.changeset/scene-plane.md +0 -8
- package/.changeset/site-og.md +0 -5
- package/.cursor/rules/aeon-ui.mdc +0 -22
- package/ACCESSIBILITY.md +0 -32
- package/AGENTS.md +0 -226
- package/COMPONENTS.md +0 -41
- package/FRAMEWORKS.md +0 -57
- package/PHILOSOPHY.md +0 -71
- package/PUBLISHING.md +0 -85
- package/SCENE.md +0 -113
- package/STATES.md +0 -243
- package/apps/demo/index.html +0 -31
- package/apps/demo/og.config.mjs +0 -20
- package/apps/demo/package.json +0 -41
- package/apps/demo/public/favicon.svg +0 -16
- package/apps/demo/public/og-aeon-ui-engine.png +0 -0
- package/apps/demo/public/og.svg +0 -35
- package/apps/demo/scripts/generate-og-png.mjs +0 -62
- package/apps/demo/src/App.tsx +0 -31
- package/apps/demo/src/aeonDiagrams.ts +0 -42
- package/apps/demo/src/app.css +0 -16
- package/apps/demo/src/components/ActionCluster.tsx +0 -20
- package/apps/demo/src/components/AsyncMachineDemo.tsx +0 -97
- package/apps/demo/src/components/ButtonLifecycleDemo.tsx +0 -63
- package/apps/demo/src/components/CodeExample.tsx +0 -7
- package/apps/demo/src/components/ComboboxDemo.tsx +0 -30
- package/apps/demo/src/components/DiagramsSection.tsx +0 -37
- package/apps/demo/src/components/FieldStateDemo.tsx +0 -51
- package/apps/demo/src/components/GridMesh.tsx +0 -8
- package/apps/demo/src/components/HeroInstall.tsx +0 -13
- package/apps/demo/src/components/LandingFaq.tsx +0 -29
- package/apps/demo/src/components/LandingFooter.tsx +0 -30
- package/apps/demo/src/components/LandingHeader.tsx +0 -62
- package/apps/demo/src/components/LandingHero.tsx +0 -55
- package/apps/demo/src/components/LayersSection.tsx +0 -47
- package/apps/demo/src/components/MermaidDiagram.tsx +0 -86
- package/apps/demo/src/components/PhilosophySection.tsx +0 -31
- package/apps/demo/src/components/PlaygroundBlock.tsx +0 -18
- package/apps/demo/src/components/PlaygroundControlsDemo.tsx +0 -63
- package/apps/demo/src/components/PlaygroundSection.tsx +0 -120
- package/apps/demo/src/components/ScrollRegionDemo.tsx +0 -74
- package/apps/demo/src/components/ThemeSwitcher.tsx +0 -79
- package/apps/demo/src/demo-layout.css +0 -293
- package/apps/demo/src/landing.css +0 -1151
- package/apps/demo/src/main.tsx +0 -14
- package/apps/demo/src/nav.ts +0 -9
- package/apps/demo/src/site.ts +0 -218
- package/apps/demo/tsconfig.json +0 -17
- package/apps/demo/vite-plugins/og-meta.ts +0 -30
- package/apps/demo/vite.config.ts +0 -69
- package/docs/API_PATTERNS.md +0 -234
- package/docs/ARCHITECTURE.md +0 -125
- package/docs/COMPONENT_CHECKLIST.md +0 -103
- package/docs/FILE_MAP.md +0 -122
- package/docs/GLOSSARY.md +0 -125
- package/docs/INDEX.md +0 -53
- package/docs/LAYOUT_COORDINATES.md +0 -178
- package/docs/MACHINES.md +0 -171
- package/docs/MIGRATION_FROM_ARK.md +0 -295
- package/docs/VITE_CONSUMER.md +0 -114
- package/pnpm-workspace.yaml +0 -3
- package/vercel.json +0 -12
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to **aeon-ui-engine** are documented here.
|
|
4
|
+
|
|
5
|
+
Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
6
|
+
Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [1.0.3] - 2026-06-02
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- `aeon-ui-engine/vite` export — `aeonUiViteAliases()` and `aeonUiOptimizeDeps()` for npm consumers.
|
|
13
|
+
- **[CONSUMER.md](./CONSUMER.md)** — accurate install, Vite alias, and TypeScript path setup.
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- npm tarball excludes monorepo dev apps (`.npmignore`); ships `packages/`, `scripts/`, and consumer docs only.
|
|
18
|
+
- Site hero and FAQ document peer deps plus required Vite wiring (not `import` alone after `npm install aeon-ui-engine`).
|
|
19
|
+
|
|
20
|
+
## [1.0.2] - 2026-06-02
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
|
|
24
|
+
- Shared Panda tokens `controlMinHXs`, `controlMinHSm`, `controlMinHMd`, and `controlMinHLg` so compact control heights stay aligned across components.
|
|
25
|
+
|
|
26
|
+
### Changed
|
|
27
|
+
|
|
28
|
+
- Button, select trigger, and combobox input recipes reference the shared control-height tokens instead of hardcoded `rem` values.
|
|
29
|
+
- Demo header toolbar uses `size="sm"` for buttons alongside the select (same compact tier) without page-level height overrides.
|
|
30
|
+
|
|
31
|
+
## [1.0.1] - 2026-06-02
|
|
32
|
+
|
|
33
|
+
### Changed
|
|
34
|
+
|
|
35
|
+
- Open Graph preview image shows `npm install aeon-ui-engine` and is served at `/og-aeon-ui-engine.png` for cache-friendly social sharing.
|
|
36
|
+
- Demo site copy standardized on the `aeon-ui-engine` npm package name.
|
|
37
|
+
|
|
38
|
+
### Fixed
|
|
39
|
+
|
|
40
|
+
- Mobile header theme preset select shows a visible **Theme** label instead of chevron-only.
|
|
41
|
+
|
|
42
|
+
## [1.0.0] - 2026-06-02
|
|
43
|
+
|
|
44
|
+
### Added
|
|
45
|
+
|
|
46
|
+
- Initial npm release of **aeon-ui-engine** — monorepo bundle with headless statechart primitives, React bindings, Panda styled layer, and themes.
|
|
47
|
+
|
|
48
|
+
[1.0.3]: https://github.com/GenericCPU/aeon-ui/compare/v1.0.2...v1.0.3
|
|
49
|
+
[1.0.2]: https://github.com/GenericCPU/aeon-ui/compare/v1.0.1...v1.0.2
|
|
50
|
+
[1.0.1]: https://github.com/GenericCPU/aeon-ui/compare/v1.0.0...v1.0.1
|
|
51
|
+
[1.0.0]: https://github.com/GenericCPU/aeon-ui/releases/tag/v1.0.0
|
package/CONSUMER.md
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Using `aeon-ui-engine` from npm
|
|
2
|
+
|
|
3
|
+
The npm package **`aeon-ui-engine`** ships the full `@aeon-ui/*` workspace (source + prebuilt Panda CSS). Scoped packages like `@aeon-ui/react` are **not** separate npm installs — wire them through Vite (or your bundler) after installing the engine.
|
|
4
|
+
|
|
5
|
+
## 1. Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install aeon-ui-engine react react-dom xstate @xstate/react
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Use the same peer versions your app already runs (`react` 18 or 19).
|
|
12
|
+
|
|
13
|
+
## 2. Vite aliases (required)
|
|
14
|
+
|
|
15
|
+
`@aeon-ui/*` imports resolve through aliases bundled with the engine:
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
// vite.config.ts
|
|
19
|
+
import react from '@vitejs/plugin-react'
|
|
20
|
+
import { defineConfig } from 'vite'
|
|
21
|
+
import { aeonUiOptimizeDeps, aeonUiViteAliases } from 'aeon-ui-engine/vite'
|
|
22
|
+
|
|
23
|
+
export default defineConfig({
|
|
24
|
+
plugins: [react()],
|
|
25
|
+
resolve: {
|
|
26
|
+
alias: aeonUiViteAliases(),
|
|
27
|
+
},
|
|
28
|
+
optimizeDeps: aeonUiOptimizeDeps(),
|
|
29
|
+
})
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Optional: point at a local monorepo checkout instead of npm (contributors):
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
aeonUiViteAliases({ packagesRoot: '/path/to/aeon-ui/packages' })
|
|
36
|
+
// or set AEON_UI_ROOT=/path/to/aeon-ui
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## 3. TypeScript paths
|
|
40
|
+
|
|
41
|
+
Extend the engine base config and map scoped imports to the bundled packages:
|
|
42
|
+
|
|
43
|
+
```json
|
|
44
|
+
{
|
|
45
|
+
"extends": "../node_modules/aeon-ui-engine/tsconfig.base.json",
|
|
46
|
+
"compilerOptions": {
|
|
47
|
+
"paths": {
|
|
48
|
+
"@aeon-ui/core": ["../node_modules/aeon-ui-engine/packages/core/src/index.ts"],
|
|
49
|
+
"@aeon-ui/primitives": ["../node_modules/aeon-ui-engine/packages/primitives/src/index.ts"],
|
|
50
|
+
"@aeon-ui/react": ["../node_modules/aeon-ui-engine/packages/react/src/index.ts"],
|
|
51
|
+
"@aeon-ui/ui": ["../node_modules/aeon-ui-engine/packages/ui/src/index.ts"],
|
|
52
|
+
"@aeon-ui/surface": ["../node_modules/aeon-ui-engine/packages/surface/src/index.ts"],
|
|
53
|
+
"@aeon-ui/panda/styled-system/css": [
|
|
54
|
+
"../node_modules/aeon-ui-engine/packages/panda/styled-system/css/index.d.ts"
|
|
55
|
+
],
|
|
56
|
+
"@aeon-ui/panda/styled-system/recipes": [
|
|
57
|
+
"../node_modules/aeon-ui-engine/packages/panda/styled-system/recipes/index.d.ts"
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Adjust `../node_modules/…` if your app tsconfig lives deeper than one folder from the repo root.
|
|
65
|
+
|
|
66
|
+
## 4. Import CSS once (styled layer)
|
|
67
|
+
|
|
68
|
+
```tsx
|
|
69
|
+
import '@aeon-ui/panda/styles.css'
|
|
70
|
+
import '@aeon-ui/panda/theme-runtime.css'
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Add `scrollbars.css` / `chrome.css` when you want the demo chrome. See [INTEGRATION.md](./INTEGRATION.md).
|
|
74
|
+
|
|
75
|
+
## 5. Use components
|
|
76
|
+
|
|
77
|
+
```tsx
|
|
78
|
+
import { Button, Dialog } from '@aeon-ui/ui'
|
|
79
|
+
import { useAeonMachine } from '@aeon-ui/react'
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Headless-only apps can import from `@aeon-ui/react` and style with `data-aeon-*` selectors — see [docs/VITE_CONSUMER.md](./docs/VITE_CONSUMER.md).
|
|
83
|
+
|
|
84
|
+
## Reference consumer
|
|
85
|
+
|
|
86
|
+
The [Casino-games](https://github.com/GenericCPU/Casino-games) repo uses this exact pattern (`scripts/vite.casino.mjs`, root `aeon-ui-engine` dependency).
|
package/INTEGRATION.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
**Agents:** [AGENTS.md](./AGENTS.md) · [docs/API_PATTERNS.md](./docs/API_PATTERNS.md)
|
|
4
4
|
|
|
5
|
+
**npm consumers:** start with **[CONSUMER.md](./CONSUMER.md)** — install `aeon-ui-engine`, peer deps, and `aeonUiViteAliases()` before any `@aeon-ui/*` import works.
|
|
6
|
+
|
|
5
7
|
Aeon UI is **three layers**. You can use one or all.
|
|
6
8
|
|
|
7
9
|
## 1. Headless only (`@aeon-ui/react`)
|
package/README.md
CHANGED
|
@@ -25,15 +25,26 @@ Aeon UI models interactive behavior as executable [statecharts](https://www.thes
|
|
|
25
25
|
|
|
26
26
|
## Quick start
|
|
27
27
|
|
|
28
|
-
The monorepo is published on npm as **`aeon-ui-engine
|
|
28
|
+
The monorepo is published on npm as **`aeon-ui-engine`** (bundles all `@aeon-ui/*` workspace packages):
|
|
29
29
|
|
|
30
30
|
```bash
|
|
31
|
-
npm install aeon-ui-engine
|
|
31
|
+
npm install aeon-ui-engine react react-dom xstate @xstate/react
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
**Important:** `@aeon-ui/react`, `@aeon-ui/ui`, etc. are **not** separate npm packages yet. After installing the engine, wire Vite so those imports resolve:
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
import { aeonUiOptimizeDeps, aeonUiViteAliases } from 'aeon-ui-engine/vite'
|
|
35
38
|
|
|
36
|
-
|
|
39
|
+
export default defineConfig({
|
|
40
|
+
resolve: { alias: aeonUiViteAliases() },
|
|
41
|
+
optimizeDeps: aeonUiOptimizeDeps(),
|
|
42
|
+
})
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Full copy-paste setup (TypeScript paths, CSS imports): **[CONSUMER.md](./CONSUMER.md)**.
|
|
46
|
+
|
|
47
|
+
Open [https://github.com/GenericCPU/aeon-ui](https://github.com/GenericCPU/aeon-ui) for the repo. The marketing demo lives at [https://aeon-ui.com](https://aeon-ui.com) — set `VITE_SITE_ORIGIN` to that origin in Vercel so Open Graph previews resolve the social image in `apps/demo/public/` correctly.
|
|
37
48
|
|
|
38
49
|
After changing recipes or tokens in `packages/panda`:
|
|
39
50
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aeon-ui-engine",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
"./vite": "./scripts/vite-aliases.mjs",
|
|
8
|
+
"./tsconfig.base.json": "./tsconfig.base.json",
|
|
9
|
+
"./CONSUMER.md": "./CONSUMER.md"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"packages",
|
|
13
|
+
"scripts",
|
|
14
|
+
"tsconfig.base.json",
|
|
15
|
+
"CONSUMER.md",
|
|
16
|
+
"INTEGRATION.md",
|
|
17
|
+
"README.md",
|
|
18
|
+
"LICENSE",
|
|
19
|
+
"CHANGELOG.md"
|
|
20
|
+
],
|
|
5
21
|
"scripts": {
|
|
6
22
|
"build": "pnpm --filter @aeon-ui/panda run codegen && pnpm -r run build",
|
|
7
23
|
"build:headless": "pnpm --filter @aeon-ui/core --filter @aeon-ui/primitives --filter @aeon-ui/react run build",
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import { AnyStateMachine, ActorRefFrom, SnapshotFrom } from 'xstate';
|
|
2
|
+
export { setup as createAeonMachine } from 'xstate';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Aeon north star: behavior is defined as explicit state first; the interface must
|
|
6
|
+
* express the **totality** of that definition — every stable condition the model allows,
|
|
7
|
+
* and nothing the model does not allow.
|
|
8
|
+
*/
|
|
9
|
+
declare const AEON_PRINCIPLE: "State is defined first. UI represents the totality of that definition.";
|
|
10
|
+
/** Shorthand used in docs and APIs. */
|
|
11
|
+
declare const UI_IS_FUNCTION_OF_STATE: "UI = f(state)";
|
|
12
|
+
|
|
13
|
+
/** Part keys for compound components — scope + named parts for styling and docs. */
|
|
14
|
+
declare function anatomy<const T extends readonly string[]>(scope: string, parts: T): Record<T[number], T[number]> & {
|
|
15
|
+
scope: typeof scope;
|
|
16
|
+
};
|
|
17
|
+
declare const buttonAnatomy: Record<"root" | "group" | "label" | "icon", "root" | "group" | "label" | "icon"> & {
|
|
18
|
+
scope: string;
|
|
19
|
+
};
|
|
20
|
+
declare const switchAnatomy: Record<"root" | "label" | "control" | "thumb" | "hiddenInput", "root" | "label" | "control" | "thumb" | "hiddenInput"> & {
|
|
21
|
+
scope: string;
|
|
22
|
+
};
|
|
23
|
+
declare const checkboxAnatomy: Record<"root" | "label" | "control" | "hiddenInput" | "indicator", "root" | "label" | "control" | "hiddenInput" | "indicator"> & {
|
|
24
|
+
scope: string;
|
|
25
|
+
};
|
|
26
|
+
declare const dialogAnatomy: Record<"root" | "trigger" | "portal" | "backdrop" | "positioner" | "content" | "title" | "description" | "closeTrigger", "root" | "trigger" | "portal" | "backdrop" | "positioner" | "content" | "title" | "description" | "closeTrigger"> & {
|
|
27
|
+
scope: string;
|
|
28
|
+
};
|
|
29
|
+
declare const tabsAnatomy: Record<"root" | "indicator" | "trigger" | "content" | "list", "root" | "indicator" | "trigger" | "content" | "list"> & {
|
|
30
|
+
scope: string;
|
|
31
|
+
};
|
|
32
|
+
declare const accordionAnatomy: Record<"root" | "item" | "itemTrigger" | "itemContent" | "itemIndicator", "root" | "item" | "itemTrigger" | "itemContent" | "itemIndicator"> & {
|
|
33
|
+
scope: string;
|
|
34
|
+
};
|
|
35
|
+
/** Async data region — track shows every lifecycle state; readout + actions mirror snapshot. */
|
|
36
|
+
declare const asyncAnatomy: Record<"root" | "track" | "segment" | "readout" | "readoutRail" | "readoutBody" | "actions", "root" | "track" | "segment" | "readout" | "readoutRail" | "readoutBody" | "actions"> & {
|
|
37
|
+
scope: string;
|
|
38
|
+
};
|
|
39
|
+
/** Form field — orthogonal interaction × validation × submission (see STATES.md). */
|
|
40
|
+
declare const fieldAnatomy: Record<"root" | "label" | "control" | "textarea" | "message" | "hint", "root" | "label" | "control" | "textarea" | "message" | "hint"> & {
|
|
41
|
+
scope: string;
|
|
42
|
+
};
|
|
43
|
+
/** Scroll viewport — overflow axis + edge position on data-aeon-state. */
|
|
44
|
+
declare const scrollAnatomy: Record<"root" | "content" | "viewport", "root" | "content" | "viewport"> & {
|
|
45
|
+
scope: string;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Play / game surface — mat shell with table, dice, and bank regions.
|
|
49
|
+
* Use with normalized layout coords (@see docs/LAYOUT_COORDINATES.md).
|
|
50
|
+
*/
|
|
51
|
+
declare const playSurfaceAnatomy: Record<"mat" | "table" | "dice" | "bank", "mat" | "table" | "dice" | "bank"> & {
|
|
52
|
+
scope: string;
|
|
53
|
+
};
|
|
54
|
+
declare const selectAnatomy: Record<"root" | "icon" | "trigger" | "positioner" | "content" | "item" | "value", "root" | "icon" | "trigger" | "positioner" | "content" | "item" | "value"> & {
|
|
55
|
+
scope: string;
|
|
56
|
+
};
|
|
57
|
+
/** Typeahead listbox — extends select with filter input and empty state. */
|
|
58
|
+
declare const comboboxAnatomy: Record<"root" | "icon" | "content" | "item" | "input" | "empty", "root" | "icon" | "content" | "item" | "input" | "empty"> & {
|
|
59
|
+
scope: string;
|
|
60
|
+
};
|
|
61
|
+
declare const popoverAnatomy: Record<"root" | "trigger" | "positioner" | "content" | "closeTrigger" | "arrow", "root" | "trigger" | "positioner" | "content" | "closeTrigger" | "arrow"> & {
|
|
62
|
+
scope: string;
|
|
63
|
+
};
|
|
64
|
+
declare const menuAnatomy: Record<"root" | "trigger" | "positioner" | "content" | "item" | "separator", "root" | "trigger" | "positioner" | "content" | "item" | "separator"> & {
|
|
65
|
+
scope: string;
|
|
66
|
+
};
|
|
67
|
+
declare const tooltipAnatomy: Record<"root" | "trigger" | "positioner" | "content" | "arrow", "root" | "trigger" | "positioner" | "content" | "arrow"> & {
|
|
68
|
+
scope: string;
|
|
69
|
+
};
|
|
70
|
+
declare const toastAnatomy: Record<"root" | "title" | "description" | "closeTrigger" | "viewport", "root" | "title" | "description" | "closeTrigger" | "viewport"> & {
|
|
71
|
+
scope: string;
|
|
72
|
+
};
|
|
73
|
+
/** Profile image — loaded / loading / error on root `data-aeon-state`. */
|
|
74
|
+
declare const avatarAnatomy: Record<"root" | "image" | "fallback", "root" | "image" | "fallback"> & {
|
|
75
|
+
scope: string;
|
|
76
|
+
};
|
|
77
|
+
declare const separatorAnatomy: Record<"root", "root"> & {
|
|
78
|
+
scope: string;
|
|
79
|
+
};
|
|
80
|
+
/** Progress bar — idle / loading / complete on root `data-aeon-state`. */
|
|
81
|
+
declare const progressAnatomy: Record<"root" | "label" | "track" | "range", "root" | "label" | "track" | "range"> & {
|
|
82
|
+
scope: string;
|
|
83
|
+
};
|
|
84
|
+
declare const radioGroupAnatomy: Record<"root" | "item" | "itemIndicator" | "itemControl" | "itemLabel", "root" | "item" | "itemIndicator" | "itemControl" | "itemLabel"> & {
|
|
85
|
+
scope: string;
|
|
86
|
+
};
|
|
87
|
+
declare const sliderAnatomy: Record<"root" | "thumb" | "track" | "range" | "valueText", "root" | "thumb" | "track" | "range" | "valueText"> & {
|
|
88
|
+
scope: string;
|
|
89
|
+
};
|
|
90
|
+
declare const pinInputAnatomy: Record<"root" | "input", "root" | "input"> & {
|
|
91
|
+
scope: string;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
type AttrOptions = {
|
|
95
|
+
state?: string | string[];
|
|
96
|
+
disabled?: boolean;
|
|
97
|
+
focus?: boolean;
|
|
98
|
+
highlighted?: boolean;
|
|
99
|
+
};
|
|
100
|
+
/** Scope + part on the component root (e.g. accordion root). */
|
|
101
|
+
declare function scopeAttrs(scope: string, part?: string, options?: AttrOptions): Record<string, unknown>;
|
|
102
|
+
/** Part only — use on children inside a scoped root. */
|
|
103
|
+
declare function partOnlyAttrs(part: string, options?: AttrOptions): Record<string, unknown>;
|
|
104
|
+
/** Build data-aeon-* attributes for styling unstyled parts. */
|
|
105
|
+
declare function partAttrs(scope: string, part: string, options?: AttrOptions): Record<string, unknown>;
|
|
106
|
+
|
|
107
|
+
type AeonSnapshot<M extends AnyStateMachine> = SnapshotFrom<M>;
|
|
108
|
+
type AeonActor<M extends AnyStateMachine> = ActorRefFrom<M>;
|
|
109
|
+
/** Flatten nested state value for data-aeon-state attribute. */
|
|
110
|
+
declare function stateToAttr(value: unknown): string;
|
|
111
|
+
|
|
112
|
+
/** Stable conditions the machine may occupy — mutually exclusive at a given depth. */
|
|
113
|
+
type AeonStateValue = string | {
|
|
114
|
+
[key: string]: AeonStateValue;
|
|
115
|
+
};
|
|
116
|
+
/** Events that may cause transitions. */
|
|
117
|
+
type AeonEvent = {
|
|
118
|
+
type: string;
|
|
119
|
+
} & Record<string, unknown>;
|
|
120
|
+
/**
|
|
121
|
+
* Machine context at a snapshot. Presentation is derived from this plus the active
|
|
122
|
+
* state value — never the other way around.
|
|
123
|
+
*/
|
|
124
|
+
type AeonContext<T extends Record<string, unknown> = Record<string, unknown>> = T;
|
|
125
|
+
/**
|
|
126
|
+
* Attribute contract for unstyled parts. `data-aeon-state` should enumerate the
|
|
127
|
+
* full stable condition (e.g. `open`, `checked`, `idle loading`) so styles and
|
|
128
|
+
* assistive tech reflect the complete machine definition, not a partial guess.
|
|
129
|
+
*/
|
|
130
|
+
interface AeonDataAttrs {
|
|
131
|
+
'data-aeon-scope': string;
|
|
132
|
+
'data-aeon-part': string;
|
|
133
|
+
'data-aeon-state'?: string;
|
|
134
|
+
'data-disabled'?: string;
|
|
135
|
+
'data-focus'?: string;
|
|
136
|
+
'data-highlighted'?: string;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/** Scroll axis overflow detected on a viewport element. */
|
|
140
|
+
type ScrollOverflow = 'none' | 'x' | 'y' | 'both';
|
|
141
|
+
interface ScrollSnapshot {
|
|
142
|
+
overflow: ScrollOverflow;
|
|
143
|
+
/** Space-separated value for data-aeon-state on scroll viewports. */
|
|
144
|
+
stateAttr: string;
|
|
145
|
+
atStartY: boolean;
|
|
146
|
+
atEndY: boolean;
|
|
147
|
+
betweenY: boolean;
|
|
148
|
+
atStartX: boolean;
|
|
149
|
+
atEndX: boolean;
|
|
150
|
+
betweenX: boolean;
|
|
151
|
+
}
|
|
152
|
+
/** Derive overflow + edge states from a scrollable element. */
|
|
153
|
+
declare function getScrollSnapshot(el: HTMLElement): ScrollSnapshot;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Responsive play-surface layout — logical coordinate plane + composition modes.
|
|
157
|
+
*
|
|
158
|
+
* Behavior stays in statecharts; **where** the user points is expressed in normalized
|
|
159
|
+
* coordinates (0–100) inside a measured region, independent of CSS grid vs overlay.
|
|
160
|
+
*
|
|
161
|
+
* @see docs/LAYOUT_COORDINATES.md
|
|
162
|
+
*/
|
|
163
|
+
/** Point on the normalized plane (percent of region width/height). */
|
|
164
|
+
type NormPoint = {
|
|
165
|
+
readonly x: number;
|
|
166
|
+
readonly y: number;
|
|
167
|
+
};
|
|
168
|
+
/** Axis-aligned bounds on the normalized plane (inclusive). */
|
|
169
|
+
type NormRect = {
|
|
170
|
+
readonly xMin: number;
|
|
171
|
+
readonly xMax: number;
|
|
172
|
+
readonly yMin: number;
|
|
173
|
+
readonly yMax: number;
|
|
174
|
+
};
|
|
175
|
+
/** DOM mapping: y increases upward (throws, dice) vs downward (top-left UI). */
|
|
176
|
+
type NormOrigin = 'bottom-left' | 'top-left';
|
|
177
|
+
declare const NORM_PLANE: {
|
|
178
|
+
readonly bottomLeft: "bottom-left";
|
|
179
|
+
readonly topLeft: "top-left";
|
|
180
|
+
};
|
|
181
|
+
/** How regions are composed at a breakpoint — product maps to CSS grid / absolute. */
|
|
182
|
+
type LayoutComposition = 'split' | 'stack' | 'overlay';
|
|
183
|
+
interface RegionLayoutSlot {
|
|
184
|
+
/** Logical region id (matches anatomy part or app constant). */
|
|
185
|
+
readonly region: string;
|
|
186
|
+
/** Grid area name / slot id for CSS `grid-template-areas`. */
|
|
187
|
+
readonly slot: string;
|
|
188
|
+
readonly zIndex?: number;
|
|
189
|
+
}
|
|
190
|
+
interface LayoutCompositionSpec {
|
|
191
|
+
readonly id: string;
|
|
192
|
+
readonly composition: LayoutComposition;
|
|
193
|
+
readonly regions: readonly RegionLayoutSlot[];
|
|
194
|
+
/** Interaction bounds per region in **that region's** normalized plane. */
|
|
195
|
+
readonly bounds?: Readonly<Record<string, NormRect>>;
|
|
196
|
+
}
|
|
197
|
+
type LayoutMode = 'compact' | 'wide';
|
|
198
|
+
interface ResponsiveLayoutSpec {
|
|
199
|
+
readonly modes: {
|
|
200
|
+
readonly compact: LayoutCompositionSpec;
|
|
201
|
+
readonly wide: LayoutCompositionSpec;
|
|
202
|
+
};
|
|
203
|
+
/**
|
|
204
|
+
* Media query that selects `compact` when matched (default: phone portrait).
|
|
205
|
+
* When it does not match, mode is `wide`.
|
|
206
|
+
*/
|
|
207
|
+
readonly compactMq?: string;
|
|
208
|
+
}
|
|
209
|
+
declare const DEFAULT_COMPACT_MQ = "(max-width: 39.99rem)";
|
|
210
|
+
declare function clampNorm(point: NormPoint, bounds: NormRect): NormPoint;
|
|
211
|
+
declare function normFromClient(rect: DOMRectReadOnly, clientX: number, clientY: number, options?: {
|
|
212
|
+
origin?: NormOrigin;
|
|
213
|
+
bounds?: NormRect;
|
|
214
|
+
}): NormPoint;
|
|
215
|
+
declare function clientFromNorm(rect: DOMRectReadOnly, point: NormPoint, options?: {
|
|
216
|
+
origin?: NormOrigin;
|
|
217
|
+
}): {
|
|
218
|
+
clientX: number;
|
|
219
|
+
clientY: number;
|
|
220
|
+
};
|
|
221
|
+
/** Measure element; returns null if not connected. */
|
|
222
|
+
declare function measureElement(el: Element | null | undefined): DOMRect | null;
|
|
223
|
+
/** Prefer a dedicated region rect; fall back to mat when lane not mounted. */
|
|
224
|
+
declare function resolveRegionRect(primary: DOMRect | null | undefined, fallback: DOMRect | null | undefined): DOMRect | null;
|
|
225
|
+
declare function matchLayoutMode(spec: ResponsiveLayoutSpec, mq?: Pick<MediaQueryList, 'matches'>): LayoutMode;
|
|
226
|
+
declare function getCompactMq(spec: ResponsiveLayoutSpec): MediaQueryList;
|
|
227
|
+
declare function layoutCompositionForMode(spec: ResponsiveLayoutSpec, mode: LayoutMode): LayoutCompositionSpec;
|
|
228
|
+
declare function regionBoundsForMode(spec: ResponsiveLayoutSpec, mode: LayoutMode, regionId: string): NormRect | undefined;
|
|
229
|
+
/**
|
|
230
|
+
* Value for `data-aeon-layout-mode` on the mat root.
|
|
231
|
+
* Pair with `data-aeon-layout-composition` from the active spec.
|
|
232
|
+
*/
|
|
233
|
+
declare function layoutModeAttrs(mode: LayoutMode, composition: LayoutComposition): Record<string, string>;
|
|
234
|
+
/** Spread a norm point inside bounds (keeps cluster off edges). */
|
|
235
|
+
declare function insetNormCluster(point: NormPoint, bounds: NormRect, inset?: {
|
|
236
|
+
x?: number;
|
|
237
|
+
y?: number;
|
|
238
|
+
}): NormPoint;
|
|
239
|
+
|
|
240
|
+
type AeonColorMode = 'light' | 'dark';
|
|
241
|
+
/** Class applied to `<html>` to enable theme-transition.css */
|
|
242
|
+
declare const AEON_THEME_TRANSITION_CLASS = "aeon-theme-transition";
|
|
243
|
+
declare function isAeonColorMode(value: string): value is AeonColorMode;
|
|
244
|
+
/** Map next-themes / user prefs to Aeon `data-aeon-mode`. */
|
|
245
|
+
declare function resolveAeonColorMode(theme: string | undefined, systemPrefersDark?: boolean): AeonColorMode;
|
|
246
|
+
/**
|
|
247
|
+
* Keep `data-aeon-theme` / `data-aeon-mode` in sync with Tailwind `.dark` apps.
|
|
248
|
+
* Enables smooth transitions when paired with `@aeon-ui/core/theme-transition.css`.
|
|
249
|
+
*/
|
|
250
|
+
declare function syncAeonColorMode(root: HTMLElement, mode: AeonColorMode, options?: {
|
|
251
|
+
themeId?: string;
|
|
252
|
+
enableTransitionClass?: boolean;
|
|
253
|
+
}): void;
|
|
254
|
+
/** Cross-fade theme changes when View Transitions API is available. */
|
|
255
|
+
declare function runAeonThemeTransition(apply: () => void): void;
|
|
256
|
+
|
|
257
|
+
export { AEON_PRINCIPLE, AEON_THEME_TRANSITION_CLASS, type AeonActor, type AeonColorMode, type AeonContext, type AeonDataAttrs, type AeonEvent, type AeonSnapshot, type AeonStateValue, DEFAULT_COMPACT_MQ, type LayoutComposition, type LayoutCompositionSpec, type LayoutMode, NORM_PLANE, type NormOrigin, type NormPoint, type NormRect, type RegionLayoutSlot, type ResponsiveLayoutSpec, type ScrollOverflow, type ScrollSnapshot, UI_IS_FUNCTION_OF_STATE, accordionAnatomy, anatomy, asyncAnatomy, avatarAnatomy, buttonAnatomy, checkboxAnatomy, clampNorm, clientFromNorm, comboboxAnatomy, dialogAnatomy, fieldAnatomy, getCompactMq, getScrollSnapshot, insetNormCluster, isAeonColorMode, layoutCompositionForMode, layoutModeAttrs, matchLayoutMode, measureElement, menuAnatomy, normFromClient, partAttrs, partOnlyAttrs, pinInputAnatomy, playSurfaceAnatomy, popoverAnatomy, progressAnatomy, radioGroupAnatomy, regionBoundsForMode, resolveAeonColorMode, resolveRegionRect, runAeonThemeTransition, scopeAttrs, scrollAnatomy, selectAnatomy, separatorAnatomy, sliderAnatomy, stateToAttr, switchAnatomy, syncAeonColorMode, tabsAnatomy, toastAnatomy, tooltipAnatomy };
|