Add initial Nebula Core packages and docs

Import initial monorepo structure for Nebula Core: add packages (@nebula/core, core-glyphs, core-input, core-navigation, core-theme, core-ui, core-utils) with source, dist, tests and assets. Expand README with overview, quick start and API snippets, and add package-level documentation files. Add jsconfig.json for path mapping, package.json and lockfiles to bootstrap the repo. This commit sets up the project layout, docs, and local package links for further development.
This commit is contained in:
2026-01-31 22:57:16 +13:00
parent 40dcfc1853
commit 987ff560f5
309 changed files with 2611 additions and 1 deletions
+25
View File
@@ -0,0 +1,25 @@
# @nebula/core-ui
Minimal UI helpers for controller-first applications. No framework lock-in.
## Why it exists
Controller-first UI benefits from consistent hit targets and clear focus styling. This package provides small, composable primitives you can apply in any UI layer.
## Usage
```js
import { focusRing, hitTarget, getFocusableAttributes } from "@nebula/core-ui";
const focusableProps = getFocusableAttributes({ role: "button", focusKey: "play" });
// Example with a UI layer that accepts inline styles
const styles = {
minHeight: hitTarget.minHeight,
minWidth: hitTarget.minWidth,
outline: `${focusRing.outlineWidth}px solid ${focusRing.outlineColor}`,
outlineOffset: focusRing.outlineOffset
};
```
## SteamOS / Steam Deck notes
Use large hit targets and strong focus rings for readability on TV and handheld screens. Combine with a focus system (such as @nebula/core-navigation).
+18
View File
@@ -0,0 +1,18 @@
{
"name": "@nebulaproject/core-ui",
"private": true,
"version": "0.1.0",
"description": "Minimal, controller-first UI helpers and primitives.",
"type": "module",
"exports": "./src/index.js",
"main": "./src/index.js",
"files": [
"src"
],
"engines": {
"node": ">=18"
},
"scripts": {
"test": "node --test"
}
}
+43
View File
@@ -0,0 +1,43 @@
/**
* Recommended hit target sizes for controller-first UI.
* Values are in pixels at 100% scale.
* @type {{ minSize: number, minHeight: number, minWidth: number }}
*/
export const hitTarget = {
minSize: 48,
minHeight: 48,
minWidth: 48
};
/**
* Focus ring style tokens for UI libraries or CSS-in-JS.
* @type {{ outlineWidth: number, outlineOffset: number, outlineColor: string }}
*/
export const focusRing = {
outlineWidth: 3,
outlineOffset: 3,
outlineColor: "#8ddcff"
};
/**
* Build a minimal set of focusable attributes for controller navigation.
* Works with DOM, React, or any rendering layer that accepts plain props.
* @param {{ role?: string, tabIndex?: number, focusKey?: string }} [options]
* @returns {Record<string, string | number>}
*/
export function getFocusableAttributes(options = {}) {
const role = options.role ?? "button";
const tabIndex = options.tabIndex ?? 0;
/** @type {Record<string, string | number>} */
const attrs = {
role,
tabIndex,
"data-nebula-focus": "true"
};
if (options.focusKey) {
attrs["data-nebula-focus-key"] = options.focusKey;
}
return attrs;
}