You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte-kit-vice/src/uix/morfo/components/float.ts

41 lines
1.3 KiB

feat(layout): Layout Batch 2 — aspect-ratio, auto-grid, banner, float 4 new layout primitives, full canon (morfo + eidos full set + canon demo + README). `npm run component:audit`: 81 / 81 PASS, 0 NEEDS-WORK. **AspectRatio** — composes through Box; emits single `--aspect-ratio` CSS var (uses modern CSS `aspect-ratio` property, drops legacy padding-bottom hack). Accepts numeric (16/9 → 1.777…) or string ("16/9") values. **AutoGrid** — composes through Grid. Resolves `templateColumns` from `minItemWidth` to `repeat(auto-fill, minmax(MIN, 1fr))` in JS so the recipe stays declarative. Uses `auto-fill` (not auto-fit) to preserve empty tracks when item count is low. **Banner** — `<header role="banner">` announcement strip with intent (full 8-role UIX `ColorRole`), variant (`ChipVariant` soft/solid/ outline/ghost), size (sm/md/lg). Dismissal is composition-driven: consumer wraps in {#if show} and adds `<Banner.Close>`. No `dismissible` boolean. **Float** — CSS `float` primitive with logical `inline-start` / `inline-end` sides. Redefined from air's 9-zone overlay primitive (which becomes a future `<Positioned>` component if real demand surfaces). Useful for inline images / pull-quotes / drop caps. Each component ships morfo (`scope: ['eidos']`, 1 part, 0 events, justified) + eidos set + README (Baseline / Comparativa / Decisiones / Eventos Sema / Gaps with disposition markers / Referencias / Passive justification) + canon demo with 6 tabs. Sidebar nav appends the 4 entries to the existing Layout group. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
import type { Morfo } from '../types';
/**
* Float — CSS-`float` primitive that pulls a child to the start or end
* of a text flow so adjacent inline content wraps around it (layout
* primitive).
*
* Eidos-native: composes through `<Box>` and sets `float:inline-start`
* / `float:inline-end` plus a margin from the surrounding text via
* `--float-gap`. Typical use cases: inline images, pull-quotes, drop
* caps, side notes in long-form content.
*
* Justification for 0-event surface: Float is a pure visual /
* structural primitive. It changes how its child participates in the
* surrounding text flow and nothing else — no commit, no emerge, no
* keyboard, no ARIA. Same passive justification as `box.ts`.
*
* Note on naming: this is NOT the legacy `air/Float` 9-zone external
* placement primitive (that one was an absolutely-positioned overlay
* relative to an anchor). The CSS-`float` semantic is closer to Radix
* Themes `Inset` and MUI's pull-quote pattern — see the README's
* "Baseline" section for the design history.
*/
export const floatMorfo = {
name: 'Float',
kebab: 'float',
scope: ['eidos'],
parts: [
{
name: 'Provider',
kebab: 'provider',
archetype: 'provider',
kind: 'public',
defaultElement: 'div',
optional: false,
data: [],
aria: []
}
]
} as const satisfies Morfo;

Powered by TurnKey Linux.