This software is a very early release, and not ready for general use.

Public home: github.com/dcoai/macaw_component · Docs: hexdocs.pm

Macaw's component contract: what a component declares, the kinds it renders as, the context it renders in, the rendering modes and their rules, its drawn states, the package side of the registry, and the component conformance kit.

A component package (visualize's visuals, metresis's panels, the core's built-in components) implements this contract without the Macaw core: macaw_component holds no process, no state source and no page. Placing components on pages is the core's, macaw.

Status: v0.1.0. The contract is unstable until two implementers pass its kit, the core's table and visualize's visuals; until then every 0.x minor version may change it, and changes found by an implementer are proposals on dco-tek/macaw_compose.

ModuleWhat it isSpec
Macaw.Componentthe behavior, use with its compile-time checks, and the dispatch functions01 §1
Macaw.Component.Declarationsconfigured declarations, built and checked from declarations/1's answer01 §1.2
Macaw.Component.Slotslots, their requirements, and checking a binding against a schema01 §1.3
Macaw.Component.Statethe standard state and the value and domain types01 §1.5
Macaw.Component.Announcementannouncement requests for declared names01 §1.6
Macaw.Component.Stylesheet, Macaw.Component.Proxycontent-addressed stylesheets and same-origin proxy paths01 §1.8
Macaw.Component.Assigns, Macaw.Component.Contextwhat a component renders with02 §1–2
Macaw.Component.Modethe four rendering modes and what each allows02 §3
Macaw.Component.Drawndrawn states, their roles, glyphs, words and static notice02 §6
Macaw.Component.Clientthe fixed names of the client protocols02 §8
Macaw.Component.Packagethe package side of the registry03
Macaw.Component.Conformancethe conformance kit: twelve checks, fixtures and the visual check set (needs lazy_html)04
defmodule MyApp.CardsConformanceTest do
  use ExUnit.Case, async: true
  use Macaw.Component.Conformance, component: MyApp.Cards
end

From Hex:

{:macaw_component, "~> 0.1.2"}

The specification is in spec/.