Metadata-Version: 2.4
Name: lawsql-components
Version: 0.1.0
Summary: Normative legal-component registry and executable reference for LawSQL readers.
Keywords: legal-tech,components,datasette,django
Author: Marcelino Veloso III
License-Expression: BSD-3-Clause
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.14
Classifier: Typing :: Typed
Requires-Dist: beautifulsoup4>=4.15
Requires-Dist: jsonschema>=4.26
Requires-Dist: pyyaml>=6.0.3
Requires-Python: >=3.14
Project-URL: Repository, https://github.com/justmars/lawsql-components
Project-URL: Issues, https://github.com/justmars/lawsql-components/issues
Description-Content-Type: text/markdown

# lawsql-components

`lawsql-components` is the normative component registry and executable reference
for legal readers built on the LawSQL ecosystem. Its primary product is
documentation: legal meaning, ownership, data lineage, composition, non-inferences,
presentation rationale, accessibility, and responsive behavior are recorded before
CSS or application adapters.

[![CI](https://github.com/justmars/lawsql-components/actions/workflows/ci.yml/badge.svg)](https://github.com/justmars/lawsql-components/actions/workflows/ci.yml)

The repository deliberately separates three layers:

1. **Legal components** describe identity, meaning, composition, ordering, and
   claims that the data must not imply.
2. **Presentation components** define semantic HTML, interaction, accessibility,
   responsive behavior, and styling rationale.
3. **Host adapters** map those contracts into LawSQL or Citelaws without moving
   query, authorization, sanitization, or application-shell ownership here.

Corpus repositories, `decision-utils`, and `statute-utils` remain authoritative
for source and artifact semantics. This repository is normative for shared
presentation and integration contracts.

## Installation

Install an exact component release:

```sh
uv add "lawsql-components==0.1.0"
```

Python consumers import the typed helpers directly:

```python
from lawsql_components import decorate_legal_tree, prepare_opinions
```

Stage the dependency-free browser assets into a Django, Datasette, or other
static root without network access:

```sh
law-components install-assets --output app/static
```

This writes
`app/static/vendor/lawsql-components/0.1.0/lawsql-components.{css,js}`. The
equivalent Python API is `lawsql_components.resources.install_assets()`.

The wheel also exposes the compiled registry, source records, schema, specimens,
manifest, and license through `lawsql_components.resources`. Run
`law-components validate` to verify the installed bundle from any working
directory.

## Development

```sh
uv sync --all-groups
npm ci
just resources
just check
```

Generated outputs are committed. `just bundle-check` and `just generate-check`
rebuild into temporary directories and require byte-for-byte parity.

The package release (`version`) and registry shape (`schema_version`) evolve
independently. Registry schema version 1 is required in every YAML record and in
`dist/registry.json`; consumers must reject an unknown schema version before
reading component fields. See [versioning and migration](docs/versioning.md).

## Public surfaces

- Registry: `lawsql_components.resources.registry_data()`
- Browser assets: `lawsql_components.resources.asset_bytes()` and
  `install_assets()`
- Python: `prepare_opinions`, `namespace_fragment_ids`, and
  `decorate_legal_tree`
- Browser entry point: `window.LawSQLComponents.enhance(root = document)`

See the generated [component index](https://github.com/justmars/lawsql-components/blob/main/docs/generated/index.md),
the [architecture guide](https://github.com/justmars/lawsql-components/blob/main/docs/architecture.md),
and the [release procedure](https://github.com/justmars/lawsql-components/blob/main/docs/releasing.md).
