# @42/core

Headless UI controllers written in vanilla TypeScript. Each controller enhances
your own markup, leaving styling entirely up to you — pair it with
[`@42/styles`](../styles) for a ready-made theme, or bring your own CSS.

```bash
npm install @42/core
```

## Usage

Every controller follows the same `HeadlessController` contract
(`on` / `destroy` / optional `update` / `getState`):

```ts
import { Accordion } from '@42/core';

const accordion = new Accordion(document.querySelector('[data-c42-accordion]')!, {
  multiple: true,
});

accordion.on('change', (detail) => console.log(detail));

// later
accordion.destroy();
```

Subpath imports keep bundles small — import only the controllers you use:

```ts
import { Tabs } from '@42/core/tabs';
import '@42/core/tabs/style.css';
```

## Manifest

The package ships a `manifest.json` describing every component — its options,
events, methods and `data-c42-*` markup contract. It is the single source of
truth consumed by the docs, the framework adapters
([`@42/react`](../react), [`@42/vue`](../vue)) and [`@42/blade`](../blade).

```ts
import manifest from '@42/core/manifest.json';
```

## Framework adapters

- React → [`@42/react`](../react)
- Vue 3 → [`@42/vue`](../vue)
- Blade / plain markup auto-mount → [`@42/blade`](../blade)

## License

MIT © [Laravel42](https://laravel42.com)
