@elaraai/east-ui-components

中文文档
1.0.107发布于 2026/11/13AGPL-3.0-or-laterTypeScriptESM + CJS构建来源已验证近 30 天下载 3801

React components for rendering East UI types with Chakra UI

原始使用文档
文档目录13 节
  1. Features
  2. Installation
  3. Quick Start
  4. Brand fonts
  5. Theme
  6. State Management
  7. Supported Components
  8. Development
  9. Claude Code plugin
  10. License
  11. Ecosystem
  12. Links
  13. About Elara

East UI Components

React rendering components for East UI

License Node Version

East UI Components provides React components that render East UI data structures. It bridges the gap between East UI's declarative component definitions and interactive React applications using Chakra UI v3.

Features

  • Chakra UI v3 - Modern, accessible component rendering
  • All East UI Components - Full support for layout, forms, charts, overlays, and more
  • State Management - React hooks for East state operations
  • Recharts Integration - Charts rendered using Recharts library
  • Type-Safe - Full TypeScript support

Installation

npm install @elaraai/east-ui-components @elaraai/east-ui @elaraai/east

Quick Start

import React from "react";
import { Provider } from "@chakra-ui/react";
import { East } from "@elaraai/east";
import { Stack, Text, Button, UIComponentType } from "@elaraai/east-ui";
import { EastUIComponent, system } from "@elaraai/east-ui-components";

// Define your East UI component
const MyUI = East.function([], UIComponentType, $ => {
    return Stack.Root([
        Text.Root("Hello from East UI!", { fontSize: "xl" }),
        Button.Root("Click Me", { variant: "solid", colorPalette: "blue" }),
    ], { gap: "4" });
});

// Compile and get the UI IR
const compiled = East.compile(MyUI);
const uiData = compiled();

// Render in React
function App() {
    return (
        <Provider value={system}>
            <EastUIComponent ir={uiData} />
        </Provider>
    );
}

Brand fonts

The theme sets text in DM Sans, Inter Tight and Chivo Mono. An app registers them once, in its entry module:

import "@elaraai/east-ui-components/fonts";

The entry imports the self-hosted @fontsource-variable/* stylesheets — the three families upright, and Chivo Mono italic for the muted "no data" value. The app's bundler emits them with their .woff2 files, in a dev server and in a production build, and nothing is fetched from a CDN. The fonts are a separate entry so that importing the components never needs a CSS loader, which Node test runners lack.

No letters are joined: the page sets font-variant-ligatures: no-common-ligatures, so ff, fi and fl stay separate letters in every face, and each of Chivo Mono's letters keeps its own cell.

Theme

system is the design system as a Chakra v3 system. Wrap the app in <ChakraProvider value={system}>, and Chakra's own parts take it as well as the East components.

Brand is the default colour palette. A part with no colorPalette takes the brand, so a <Button> is the design system's primary in both themes: its fill, a label at 4.5:1 or more, and a deeper fill on hover. A checked <Switch> has the brand track. Parts the design system draws neutral stay neutral, held so in their own recipes: tags, badges, avatars, key caps, code chips, tabs, table rows, progress tracks, and every button that isn't the primary (outline, ghost, subtle, surface, plain). A colorPalette prop on a part, or on an ancestor of a part that doesn't pin its own, still selects another palette.

A composite field draws its focus ring on the bordered wrapper with _focusWithin: { borderColor: "brand.solid", boxShadow: "focus", outline: "none" }. Its inner editing field must opt out of both Chakra's ring and the theme's universal :focus-visible shadow:

import type { SystemStyleObject } from "@chakra-ui/react";

const fieldInRingedControl = {
    focusVisibleRing: "none",
    _focusVisible: { outline: "none", boxShadow: "none" },
} satisfies SystemStyleObject;

Spread this into the inner field's slot recipe. outline: "none" alone leaves a second shadow, even on a mouse click into a text input. If Chakra's default variant supplies focus styles, put the opt-out in that variant: merged variant styles override custom base styles. The theme uses the shared fieldInRingedControl and the combobox outline variant demonstrates that placement.

Keep the opt-out scoped to fields whose wrapper supplies the ring. Standalone inputs and independently focusable actions, such as a search's clear button, still need their own focus indicator. Segmented dates and times retain the active segment's fill and border inside the wrapper. Verify custom composites in a real browser, in both themes and with both mouse and keyboard focus: the wrapper's computed box-shadow must equal the focus token and the inner field's must be none.

State Management

East UI Components provides hooks for managing state in East applications:

import { useEastStore, useEastState } from "@elaraai/east-ui-components";
import { State } from "@elaraai/east-ui";

// In your East function
const MyComponent = East.function([], UIComponentType, $ => {
    const count = $.let(State.read("counter", IntegerType, 0n));
    return Button.Root(
        East.str`Count: ${count}`,
        { onClick: State.write("counter", count.add(1n)) }
    );
});

// In your React app
function App() {
    const store = useEastStore();
    const [count] = useEastState(store, "counter", 0n);

    return (
        <Provider value={system}>
            <EastUIComponent ir={uiData} store={store} />
            <p>Current count: {count}</p>
        </Provider>
    );
}

Supported Components

All East UI components are supported:

CategoryComponents
LayoutBox, Stack, HStack, VStack, Grid, Splitter, Separator
TypographyText, Code, Heading, Link, Highlight, Mark, List, CodeBlock
ButtonsButton, IconButton
FormsInput (String, Integer, Float, DateTime), Select, Checkbox, Switch, Slider, Textarea, TagsInput, FileUpload, Field, Fieldset
CollectionsTable, DataList, TreeView
ChartsArea, Bar, Line, Pie, Radar, Scatter, Sparkline, BarList, BarSegment
DisplayBadge, Tag, Avatar, Stat, Icon
FeedbackAlert, Progress
DisclosureAccordion, Tabs, Carousel
OverlaysDialog, Drawer, Popover, Tooltip, Menu, HoverCard, ToggleTip, ActionBar
ContainerCard

Development

npm run build     # Build library
npm run dev       # Start development server
npm run lint      # Check code quality

Claude Code plugin

The East ecosystem also ships a Claude Code plugin — East language skills, example search, and preemptive diagnostics for East code — installed separately from the elaraai marketplace:

# Inside Claude Code
/plugin marketplace add elaraai/east-workspace
/plugin install east@elaraai
# From a terminal
claude plugin marketplace add elaraai/east-workspace
claude plugin install east@elaraai

License

Dual-licensed:

Ecosystem

  • East: Statically typed, expression-based language with serializable IR. Run portable logic across TypeScript, Python, C, and other runtimes.

    • @elaraai/east: Core language SDK with type system, expressions, and reference JS compiler
  • East Node: Node.js platform functions for I/O, databases, and system operations.

  • East C: C11 native runtime for executing East IR. Tarballed for linux-x64 and linux-arm64, attached to each GitHub Release.

    • east-c: Core runtime — type system, IR interpreter, 200+ builtins, serialization (Beast2, JSON, CSV, East text)
    • east-c-std: Console, FileSystem, Fetch, Crypto, Time, Path, Random
    • east-c-cli: CLI for running East IR programs natively
  • East Python: Python runtime, standard platform, I/O, and data-science platform functions. Published to PyPI.

    • east-py: Core Python runtime — type system, IR compiler, 212+ builtins, Cython-accelerated hot paths
    • east-py-std: Console, FileSystem, Fetch, Crypto, Time, Path, Random
    • east-py-io: SQLite, PostgreSQL, MySQL, MongoDB, Redis, S3, FTP, SFTP, XLSX, XML, compression
    • east-py-cli: CLI for running East IR programs in Python
    • east-py-datascience (PyPI) + @elaraai/east-py-datascience (npm): Optimization (MADS, Optuna, ALNS, GoogleOR), ML (XGBoost, LightGBM, NGBoost, PyTorch, Lightning, GP), Bayesian inference (PyMC), explainability (SHAP), conformal prediction (MAPIE)
  • East UI: Typed UI component definitions and React renderer, plus VS Code preview.

  • e3 — East Execution Engine: Durable execution engine for running East pipelines at scale. Git-like content-addressable storage, automatic memoization, reactive dataflow, real-time monitoring.

About Elara

East is developed by Elara AI Pty Ltd, an AI-powered platform that creates economic digital twins of businesses that optimize performance. Elara combines business objectives, decisions and data to help organizations make data-driven decisions across operations, purchasing, sales and customer engagement, and project and investment planning. East powers the computational layer of Elara solutions, enabling the expression of complex business logic and data in a simple, type-safe and portable language.


Developed by Elara AI Pty Ltd.


Developed by Elara AI Pty Ltd - Powering the computational layer of AI-driven business optimization.

版本与发布记录

@elaraai/east-ui-components 共发布 154 个版本,首次发布于 2025/12/01;过去 12 个月发布了 154 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.0.107latest2026/11/13今天
1.0.1062026/11/094 天前
1.0.1052026/11/085 天前
1.0.1042026/11/067 天前
1.0.1032026/11/049 天前
1.0.1022026/11/0310 天前

其他发布通道:beta → 0.0.1-beta.45。

关于 @elaraai/east-ui-components 的常见问题

@elaraai/east-ui-components 是什么?

React components for rendering East UI types with Chakra UI

如何安装 @elaraai/east-ui-components?

在项目目录运行 npm install @elaraai/east-ui-components,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(^19.0.0)、react-dom(^19.0.0)、@elaraai/east(1.0.107)、@elaraai/east-ui(1.0.107)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@elaraai/east-ui-components 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@elaraai/east-ui-components 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@elaraai/east-ui-components 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@elaraai/east-ui-components 可以商用吗?

@elaraai/east-ui-components 使用 AGPL-3.0-or-later 许可。最严格的 Copyleft:除分发外,通过网络向用户提供基于它的服务也需要开源对应源码。闭源 SaaS 使用前务必评估。以上为概括,不构成法律意见,请以许可原文为准。

@elaraai/east-ui-components 的下载量有多少?

根据 npm 官方下载统计,@elaraai/east-ui-components 在 2026/10/13 – 2026/11/11 这 30 天内被下载 3,801 次,日均约 127 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@elaraai/east-ui-components 还在维护吗?

最新版本 1.0.107 发布于 2026/11/13(今天);至今共发布 154 个版本,其中过去 12 个月发布了 154 个;首次发布于 2025/12/01。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。