diff --git a/CLAUDE.md b/CLAUDE.md index 6b52f63..4050d1d 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -267,6 +267,8 @@ Follow these stages in order. **Do not skip or merge stages.** - `package.json` — add `"./x-"` entry under `"exports"` - `src/baredom/registry.cljs` — require the export namespace and add `/register!` to `all-registers` (single source of truth; `baredom.core/start!` and `baredom.exports.all/init` both consume this vector) - `public/index.html` — add an entry to the `components` array in the ` ``` -Ships with **8 built-in presets**: `default`, `ocean`, `forest`, `sunset`, `neo-brutalist`, `aurora`, `mono-ai`, `warm-mineral`. All presets include both light and dark mode values that work with `prefers-color-scheme`. - -For custom themes, register your own preset via JavaScript: - -```js -import { registerPreset } from '@vanelsas/baredom/x-theme'; +For deeper usage by stack, see the [JavaScript Developer Guide](./docs/javascript-guide.md), [TypeScript Guide](./docs/typescript.md), or [ClojureScript Guide](./docs/clojurescript-guide.md). -registerPreset('acme', { - light: { '--x-color-primary': '#e11d48', '--x-color-surface': '#fff' }, - dark: { '--x-color-primary': '#fb7185', '--x-color-surface': '#1a1a2e' } -}); -``` +--- -```html -... -``` +## Framework adapters -Or override individual tokens via CSS: +BareDOM components are native HTML elements — they work natively in any framework, with no adapter required. The published adapters below add typed props, typed custom events, and framework-idiomatic ergonomics on top of the same underlying components. -```html - - ... - -``` +| Framework | Package | Minimum version | Docs | +|-----------|---------|-----------------|------| +| React 19+ | `@vanelsas/baredom-react` | 2.6.0 | [README](./adapters/react/README.md) · [npm](https://www.npmjs.com/package/@vanelsas/baredom-react) | +| Vue 3.4+ | `@vanelsas/baredom-vue` | 2.6.0 | [README](./adapters/vue/README.md) · [npm](https://www.npmjs.com/package/@vanelsas/baredom-vue) | +| Angular 17+ | `@vanelsas/baredom-angular` | 2.6.0 | [README](./adapters/angular/README.md) · [npm](https://www.npmjs.com/package/@vanelsas/baredom-angular) | +| Svelte 5+ | `@vanelsas/baredom-svelte` | 2.6.0 | [README](./adapters/svelte/README.md) · [npm](https://www.npmjs.com/package/@vanelsas/baredom-svelte) | +| Solid 1.9+ | `@vanelsas/baredom-solid` | 2.6.0 | [README](./adapters/solid/README.md) · [npm](https://www.npmjs.com/package/@vanelsas/baredom-solid) | -See [docs/x-theme.md](./docs/x-theme.md) for the full token list, preset details, and API reference. +All adapters are auto-generated from the same Custom Elements Manifest, so adding a new BareDOM component updates every adapter in lockstep. --- -## Installation +## Components -```bash -npm install @vanelsas/baredom -``` +**103 web components across 11 categories** — from foundational UI controls to morphing animations, organic effects, and scroll-driven storytelling. -```js -import { init } from '@vanelsas/baredom/x-button'; -init(); -``` +| Category | Count | Examples | +|----------|------:|----------| +| **Form** | 23 | Button · Checkbox · Slider · Combobox · OTP Input · Color Picker | +| **Feedback** | 11 | Alert · Toast · Spinner · Progress · Skeleton · Notification Center | +| **Navigation** | 8 | Navbar · Sidebar · Breadcrumbs · Tabs · Pagination · Menu | +| **Layout** | 10 | Card · Grid · Bento Grid · Split Pane · Container · Collapse | +| **Data** | 11 | Avatar · Table · Chart · Timeline · Calendar · Stat | +| **Overlay** | 9 | Modal · Drawer · Popover · Tooltip · Welcome Tour · Command Palette | +| **Display** | 6 | Icon · Image · Typography · Code · Kbd · Spotlight Card | +| **Animation** | 6 | Kinetic Canvas · Kinetic Typography · Morph Stack · Soft Body · Splash | +| **Effects** | 12 | Liquid Glass · Confetti · Neural Glow · Metaball Cursor · Organic Shape | +| **Scroll** | 5 | Scroll · Scroll Parallax · Scroll Stack · Scroll Story · Scroll Timeline | +| **Utility** | 2 | i18n · i18n Provider | -Also available via [Clojars](./docs/installation.md#clojurescript-via-clojars) and [standalone ES modules](./docs/installation.md#vanilla-htmljs-via-es-modules). See the [full installation guide](./docs/installation.md). +See [**docs/components.md**](./docs/components.md) for the full per-component catalogue with one-line descriptions and links to each component's API documentation. --- -## Usage +## Time-Travel Debugger -BareDOM components are native HTML elements. Import, register, and use them in any framework or vanilla HTML. +[`x-trace-history`](./docs/x-trace-history.md) is BareDOM's dev-only debugger. It records every CustomEvent dispatch, observed attribute change, instance-field write, and lifecycle callback as a navigable timeline with cause→effect navigation — so when a bug appears, you can step back to the exact event that caused it. -- **JavaScript / TypeScript** — see the [JavaScript Developer Guide](./docs/javascript-guide.md) -- **TypeScript types** — see the [TypeScript Guide](./docs/typescript.md) -- **ClojureScript** — see the [ClojureScript Guide](./docs/clojurescript-guide.md) -- **React** — see [`@vanelsas/baredom-react`](https://www.npmjs.com/package/@vanelsas/baredom-react) -- **Angular** — see [`@vanelsas/baredom-angular`](https://www.npmjs.com/package/@vanelsas/baredom-angular) +- **Zero production cost.** When inactive, the recorder pays a single nil-check per hook site and no per-event overhead. +- **One-line activation.** `import "@vanelsas/baredom/x-trace-history"` and append `?baredom-trace-history` to the URL — a floating dock attaches to the viewport. +- **Bug-share via URL.** Record a session, copy the URL, and the recipient sees the same timeline. +- **Adapter-aware.** Works alongside the React, Vue, Angular, Svelte, and Solid adapters. ---- +See [`docs/x-trace-history.md`](./docs/x-trace-history.md) for the full guide — search, console API, recording sessions, import/export, and the JSON schema. -## Components +--- -### Form (17) - -| Tag | Description | -|-----|-------------| -| [``](./docs/x-button.md) | Action control. Variants: `primary`, `secondary`, `tertiary`, `ghost`, `danger`. Sizes: `sm`, `md`, `lg`. States: `disabled`, `loading`, `pressed`. Icon slots. | -| [``](./docs/x-checkbox.md) | Boolean input. Reflects `checked` and `indeterminate` states to attributes. | -| [``](./docs/x-color-picker.md) | Colour picker with 2D saturation/brightness area, hue strip, optional alpha, preset swatches, eyedropper, and clipboard copy. Inline or popover mode. | -| [``](./docs/x-copy.md) | Copy-to-clipboard utility button with success feedback. | -| [``](./docs/x-currency-field.md) | Formatted currency input with locale-aware masking. | -| [``](./docs/x-date-picker.md) | Calendar-based date selection with keyboard navigation. | -| [``](./docs/x-fieldset.md) | Groups related form controls with a styled legend. | -| [``](./docs/x-file-download.md) | Download trigger that initiates a file transfer. | -| [``](./docs/x-form.md) | Form wrapper with coordinated validation state. | -| [``](./docs/x-form-field.md) | Label + input wrapper with error and hint text slots. | -| [``](./docs/x-radio.md) | Single-choice input within a radio group. | -| [``](./docs/x-search-field.md) | Search input with integrated clear button and search icon. | -| [``](./docs/x-select.md) | Dropdown select control with custom styling. | -| [``](./docs/x-slider.md) | Range slider with step, min/max, and value display. | -| [``](./docs/x-stepper.md) | Multi-step form progress indicator with navigation. | -| [``](./docs/x-switch.md) | Toggle switch for boolean settings. | -| [``](./docs/x-text-area.md) | Multi-line text input with auto-resize option. | - -### Feedback (10) - -| Tag | Description | -|-----|-------------| -| [``](./docs/x-alert.md) | Semantic alert banner. Types: `info`, `success`, `warning`, `error`. Auto-dismiss with `timeout-ms`. Fires `x-alert-dismiss`. | -| [``](./docs/x-badge.md) | Small inline label for counts, states, and categories. | -| [``](./docs/x-chip.md) | Compact tag component, optionally removable. | -| [``](./docs/x-notification-center.md) | Notification hub for aggregating and managing in-app notifications. | -| [``](./docs/x-progress.md) | Linear progress bar with determinate and indeterminate modes. | -| [``](./docs/x-progress-circle.md) | Circular progress indicator for compact spaces. | -| [``](./docs/x-skeleton.md) | Animated loading placeholder that mirrors content shape. | -| [``](./docs/x-spinner.md) | Inline loading spinner with size and colour variants. | -| [``](./docs/x-toast.md) | Single transient notification with enter/exit animations and auto-dismiss. | -| [``](./docs/x-toaster.md) | Toast manager. Positions a queue of `` elements, enforces `max-toasts`, and fires `x-toaster-dismiss`. | - -### Navigation (8) - -| Tag | Description | -|-----|-------------| -| [``](./docs/x-breadcrumbs.md) | Hierarchical path trail with separator customisation. | -| [``](./docs/x-menu.md) | Vertical menu container coordinating `` children. | -| [``](./docs/x-menu-item.md) | Individual menu entry with icon, label, description, and keyboard support. | -| [``](./docs/x-navbar.md) | Top navigation bar with responsive slot layout. | -| [``](./docs/x-pagination.md) | Page navigation controls with first/previous/next/last and page-size selection. | -| [``](./docs/x-sidebar.md) | Collapsible side navigation panel with collapse/expand animation. | -| [``](./docs/x-tab.md) | Individual tab within an `` container. | -| [``](./docs/x-tabs.md) | Tab container that coordinates `` children, manages active state, and fires change events. | - -### Layout (6) - -| Tag | Description | -|-----|-------------| -| [``](./docs/x-card.md) | Surface container. Variants: `elevated`, `outlined`, `filled`, `ghost`. Interactive mode available. | -| [``](./docs/x-collapse.md) | Expandable/collapsible section with animated height transition. | -| [``](./docs/x-container.md) | Responsive max-width container with configurable padding. | -| [``](./docs/x-divider.md) | Horizontal or vertical visual separator. | -| [``](./docs/x-grid.md) | CSS Grid layout component with responsive column configuration. | -| [``](./docs/x-spacer.md) | Flexible spacing element for flexbox and grid layouts. | - -### Data (10) - -| Tag | Description | -|-----|-------------| -| [``](./docs/x-avatar.md) | User photo or initials display. Shape, size, and status dot variants. | -| [``](./docs/x-avatar-group.md) | Overlapping avatar stack for representing multiple users. | -| [``](./docs/x-carousel.md) | Accessible carousel with swipe/drag, arrows, dot indicators, autoplay, slide/fade transitions, and horizontal/vertical orientation. | -| [``](./docs/x-chart.md) | Data visualisation component for common chart types. | -| [``](./docs/x-stat.md) | KPI / metric card with value, label, trend, and icon slots. | -| [``](./docs/x-table.md) | Data grid using CSS subgrid. Supports sorting, single/multi-select, striping, and accessible captions. | -| [``](./docs/x-table-cell.md) | Table cell for header and data modes, with sort indicator and alignment control. | -| [``](./docs/x-table-row.md) | Table row with interactive selection and `x-table-row-select` event. | -| [``](./docs/x-timeline.md) | Vertical timeline container that coordinates `` children. | -| [``](./docs/x-timeline-item.md) | Individual timeline event with time, icon, heading, and body slots. | - -### Overlay (7) - -| Tag | Description | -|-----|-------------| -| [``](./docs/x-cancel-dialogue.md) | Confirmation modal for destructive cancel actions. | -| [``](./docs/x-command-palette.md) | Keyboard-accessible global search and command interface. | -| [``](./docs/x-context-menu.md) | Right-click / long-press contextual action menu. | -| [``](./docs/x-drawer.md) | Off-canvas sliding panel, configurable from any edge. | -| [``](./docs/x-dropdown.md) | Positioned dropdown container for menus and selection. | -| [``](./docs/x-modal.md) | Centred dialog with backdrop, focus trap, and `Escape` to close. | -| [``](./docs/x-popover.md) | Anchored popover for tooltips, help text, and contextual UI. | +## Theming ---- +Wrap any subtree in `` to apply a coordinated palette across every BareDOM component inside it. Eight presets ship in the box — `default`, `ocean`, `forest`, `sunset`, `neo-brutalist`, `aurora`, `mono-ai`, `warm-mineral` — each with light and dark variants that follow `prefers-color-scheme`. -## Design Principles +Register your own preset, override individual tokens via CSS, or nest themes for per-section palettes. See [`docs/x-theme.md`](./docs/x-theme.md) for the full API (presets, `registerPreset`, CSS overrides) and [`docs/THEMING.md`](./docs/THEMING.md) for the token catalogue. -**Stateless.** No `atom`, no signal, no reactive state container lives inside a component. Every render is a pure function of the current attributes and properties. Debugging a component means inspecting attributes in DevTools — no hidden state to hunt for. For deeper investigations, the optional [`x-trace-history`](./docs/x-trace-history.md) dev tool ships as a separate ESM module and records every dispatch, attribute change, and lifecycle callback as a navigable timeline with cause→effect chains. Load it with `