ShtukbaseStandard

Explore kit

explore-kit · versión 0.1.2
Otros

The control panel for exploration pages and lenses: a right side panel with foldable sections, presets, every control kind of the design control schema (select, segment, toggle, slider, colour dots, text), state kept in localStorage and the URL, reset and copy link. Plain JS and CSS on the token contract; the lens build copies it next to the lenses.

Sobre el paquete

Este texto aún no está traducido. Debajo está el original en inglés.

An exploration page tries a design in many variants: a card form, a cover, a radius, a glow colour. The explore kit gives such a page one standard panel for its settings, so every exploration looks and works the same, and a person can take the page and use it.

What it puts in the project:

  • /design/explore-kit/explore.js and /design/explore-kit/explore.css: the kit (plain JS and CSS, no dependencies);
  • /design/explore-kit/demo.html: the package map settings rebuilt with the panel, opened with a double click;
  • /base/explore.md: how to write an exploration page with the kit, with a minimal example.

The lenses build (0.3.4 and later) copies explore.js and explore.css into lib/ next to kit.js when the project has this package, so a lens links ../lib/explore.js the same way it links the lens kit.

The API

Explore.panel({
  title: 'Package map',
  target: document.documentElement,      // where values land: data-<name> and --x-<name> on this element
  storageKey: 'pkg-map',                 // localStorage; also read from and written to the URL (?<name>=<value>)
  sections: [{title: 'Cards', controls: {preset: {kind: 'select', options: [...]}}}],
  presets: {editorial: {preset: 'editorial', size: 'l'}},   // named bundles, shown as a first select
  onChange: (values) => {}
})

Controls follow the control schema of the design build contract: {kind, label?, options?, default?, min?, max?, step?, unit?, section?, colors?} with kind one of select, segment, bool, range, swatch, text. The details are in the page /base/explore.md (in the package: pages/base/explore.md).

Tests: bun test in the package (the schema, the state, the URL, storage and presets). The package has no norms or checks.

Páginas 4

Se copian al proyecto en estas rutas.

Archivos del paquete 2

Van a .shtukbase/packages/explore-kit/; las acciones se ejecutan desde ahí.