@shavin/skills 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/AGENTS.md +193 -0
  2. package/CHANGELOG.md +27 -0
  3. package/LICENSE +21 -0
  4. package/README.md +48 -2
  5. package/bin/hex-policy.mjs +157 -0
  6. package/bin/install.mjs +219 -0
  7. package/bin/lint-tokens.mjs +178 -0
  8. package/build.mjs +540 -0
  9. package/commands/add-composition.md +14 -0
  10. package/commands/apply-theme.md +59 -0
  11. package/commands/audit-layout.md +15 -0
  12. package/commands/audit-ui.md +42 -0
  13. package/commands/compose-page.md +16 -0
  14. package/commands/create-block.md +79 -0
  15. package/commands/create-primitive.md +40 -0
  16. package/commands/create-screen.md +45 -0
  17. package/commands/create-theme.md +41 -0
  18. package/cursor/shavin.mdc +14 -0
  19. package/package.json +66 -4
  20. package/posix-path.mjs +7 -0
  21. package/skills/core-rules.md +294 -0
  22. package/skills/layout-choreography/SKILL.md +102 -0
  23. package/skills/layout-choreography/references/fallbacks-and-accessibility.md +76 -0
  24. package/skills/layout-choreography/references/scenes.md +113 -0
  25. package/skills/layout-choreography/references/shavin-timelines.md +100 -0
  26. package/skills/layout-choreography/references/tech-and-performance.md +147 -0
  27. package/skills/layout-compositions/SKILL.md +149 -0
  28. package/skills/layout-compositions/references/adapters/shavin-ui.md +122 -0
  29. package/skills/layout-compositions/references/adapters/tailwind-html.md +100 -0
  30. package/skills/layout-compositions/references/component-language.md +105 -0
  31. package/skills/layout-compositions/references/compositions/conversion.md +286 -0
  32. package/skills/layout-compositions/references/compositions/documentation.md +125 -0
  33. package/skills/layout-compositions/references/compositions/editorial.md +126 -0
  34. package/skills/layout-compositions/references/compositions/expressive.md +151 -0
  35. package/skills/layout-compositions/references/compositions/features.md +262 -0
  36. package/skills/layout-compositions/references/compositions/gallery.md +172 -0
  37. package/skills/layout-compositions/references/compositions/hero.md +184 -0
  38. package/skills/layout-compositions/references/compositions/proof.md +194 -0
  39. package/skills/layout-compositions/references/compositions/structural.md +173 -0
  40. package/skills/layout-compositions/references/distinctiveness.md +65 -0
  41. package/skills/layout-compositions/references/foundations.md +119 -0
  42. package/skills/layout-compositions/references/metadata-schema.md +64 -0
  43. package/skills/layout-compositions/references/page-recipes.md +143 -0
  44. package/skills/layout-compositions/references/selection-guide.md +207 -0
  45. package/skills/layout-compositions/references/treatments.md +60 -0
  46. package/skills/layout-compositions/references/unsection-source-examples.md +92 -0
  47. package/skills/layout-compositions/references/visual-review.md +40 -0
  48. package/skills/layout-compositions/scripts/render_wireframes.py +138 -0
  49. package/skills/layout-compositions/scripts/validate_library.py +165 -0
  50. package/skills/layout-motion/SKILL.md +83 -0
  51. package/skills/layout-motion/references/composition-motion-map.md +69 -0
  52. package/skills/layout-motion/references/presets.md +209 -0
  53. package/skills/layout-motion/references/tokens.md +100 -0
  54. package/skills/shavin-app/SKILL.md +242 -0
  55. package/skills/shavin-app/patterns.md +35 -0
  56. package/skills/shavin-studio/SKILL.md +97 -0
  57. package/skills/shavin-webpage/SKILL.md +210 -0
  58. package/skills/shavin-webpage/editorial-craft.md +117 -0
  59. package/skills/shavin-webpage/page-architecture.md +137 -0
  60. package/skills/shavin-webpage/style-recipes.md +107 -0
  61. package/skills/visual-compositor/SKILL.md +200 -0
  62. package/skills/visual-compositor/anti-patterns.md +109 -0
  63. package/skills/visual-compositor/audit-checklist.md +162 -0
  64. package/skills/visual-compositor/cognitive-layer.md +287 -0
  65. package/skills/visual-compositor/composition-motion-map.md +167 -0
  66. package/skills/visual-compositor/concentric-laws.md +147 -0
  67. package/skills/visual-compositor/docs-mode.md +32 -0
  68. package/skills/visual-compositor/editorial-mode.md +48 -0
  69. package/skills/visual-compositor/font-pairings.md +224 -0
  70. package/skills/visual-compositor/graphics-and-assets.md +128 -0
  71. package/skills/visual-compositor/interface-polish.md +125 -0
  72. package/skills/visual-compositor/layout-restraint.md +80 -0
  73. package/skills/visual-compositor/motion-and-physics.md +257 -0
  74. package/skills/visual-compositor/page-motion-presets.md +246 -0
  75. package/skills/visual-compositor/references/EDITORIAL_EXPRESSIVE.md +163 -0
  76. package/skills/visual-compositor/spacing-core.md +386 -0
  77. package/skills/visual-compositor/spacing-dense.md +63 -0
  78. package/skills/visual-compositor/spacing-marketing.md +192 -0
  79. package/skills/visual-compositor/typography-rules.md +114 -0
  80. package/token-budget.json +86 -0
@@ -0,0 +1,149 @@
1
+ ---
2
+ name: layout-compositions
3
+ description: >
4
+ A library of 57 website section and page layout compositions (structural, hero, features,
5
+ proof, conversion, gallery, editorial, documentation, expressive) with content-based selection
6
+ rules, five swappable treatments (carded, ruled, flat, full-bleed, open), a component-language
7
+ guide for typography voice, overline/badge choice, button-vs-tabs and colour application, page
8
+ recipes, and @shavin/ui adapters. Use this whenever the user is designing, building, restyling,
9
+ reviewing or auditing a web page or any section of one — landing page, marketing site, docs site,
10
+ blog or magazine layout, portfolio, dashboard shell, hero, feature grid, bento, pricing, FAQ,
11
+ testimonials, stats, CTA, footer, navigation, gallery, article page, changelog — even if they
12
+ never say "layout" or "composition". Also use for "which layout should I use", section ordering,
13
+ page structure, and "make this page feel less generic or repetitive". For simple reveals, hovers,
14
+ count-ups and marquees, follow up with layout-motion; for pinned, scroll-scrubbed or
15
+ timeline-driven awwwards-style motion, follow up with layout-choreography.
16
+ sections:
17
+ - id: selection-guide
18
+ file: references/selection-guide.md
19
+ description: "Decision tables — which composition for which job, by content signals (~3K tokens)"
20
+ - id: treatments
21
+ file: references/treatments.md
22
+ description: "5 swappable treatments (carded, ruled, flat, full-bleed, open) with @shavin/ui recipes (~1K tokens)"
23
+ - id: distinctiveness
24
+ file: references/distinctiveness.md
25
+ description: "Sameness test, variation knobs, bold moment rules (~1K tokens)"
26
+ - id: component-language
27
+ file: references/component-language.md
28
+ description: "Overline form, button-vs-tabs, typographic voice, colour application patterns (~2K tokens)"
29
+ - id: foundations
30
+ file: references/foundations.md
31
+ description: "Measure, concentric radii, spacing rhythm, accessibility baseline, stress tests (~2K tokens)"
32
+ - id: page-recipes
33
+ file: references/page-recipes.md
34
+ description: "Pre-composed multi-section page blueprints (~1.5K tokens)"
35
+ - id: metadata-schema
36
+ file: references/metadata-schema.md
37
+ description: "Yaml frontmatter spec for composition entries (~1K tokens)"
38
+ - id: compositions-structural
39
+ file: references/compositions/structural.md
40
+ description: "ST1–ST6: nav bar, announcement, footer, page shell, app shell (~3K tokens)"
41
+ - id: compositions-hero
42
+ file: references/compositions/hero.md
43
+ description: "H1–H6: centered, split, asymmetric, full-bleed, type-led, floating elements (~3K tokens)"
44
+ - id: compositions-features
45
+ file: references/compositions/features.md
46
+ description: "F1–F9: grid, bento, alternating, card rail, tabs, sticky scroll, timeline, comparison split, ecosystem diagram (~5K tokens)"
47
+ - id: compositions-proof
48
+ file: references/compositions/proof.md
49
+ description: "S1–S3, T1–T4: stats, testimonials, logos (~3K tokens)"
50
+ - id: compositions-conversion
51
+ file: references/compositions/conversion.md
52
+ description: "C1–C5, P1–P3, Q1–Q2: CTA banners, contact, newsletter, pricing, FAQ (~4K tokens)"
53
+ - id: compositions-gallery
54
+ file: references/compositions/gallery.md
55
+ description: "G1–G6: masonry, filterable, marquee rows, case study, people, product grid (~3K tokens)"
56
+ - id: compositions-editorial
57
+ file: references/compositions/editorial.md
58
+ description: "E1–E4: article, longform, magazine, archive (~2.5K tokens)"
59
+ - id: compositions-documentation
60
+ file: references/compositions/documentation.md
61
+ description: "D1–D4: docs shell, API ref, changelog, landing (~2.5K tokens)"
62
+ - id: compositions-expressive
63
+ file: references/compositions/expressive.md
64
+ description: "X1–X5: broken-grid, type wall, sticky split, horizontal track, hover preview (~3K tokens)"
65
+ - id: adapter-shavin-ui
66
+ file: references/adapters/shavin-ui.md
67
+ description: "@shavin/ui adapter — Grid, Flex, Section, Card, Container, tokens, concentric radius, component language (~2K tokens)"
68
+ - id: adapter-tailwind-html
69
+ file: references/adapters/tailwind-html.md
70
+ description: "Semantic HTML + Tailwind adapter for non-@shavin/ui projects (~1.5K tokens)"
71
+ ---
72
+
73
+ - Token-efficient usage: `get_skill({ name: "layout-compositions", section: "<id>" })` with `selection-guide`, `page-recipes`, `compositions-<family>` (structural, hero, features, proof, conversion, gallery, editorial, documentation, expressive), `treatments`, `component-language`, `foundations`, `adapter-shavin-ui`.
74
+ - Load a family file only when you use one of its IDs. Loading the whole library wastes context.
75
+ - Core rules (tokens, radius, typography) are in `.agents/skills/core-rules.md` and are not injected. Read it when you need the full detail.
76
+ - The library has 57 compositions in 9 families (F1–F9 in Features; pricing P1–P3 lives in the conversion file).
77
+
78
+ # Layout Compositions
79
+
80
+ A composition is a **spatial arrangement** of a section: columns, spans, order, what goes where. It is deliberately separate from two other layers:
81
+
82
+ | Layer | Question it answers | Where it lives |
83
+ |---|---|---|
84
+ | **Skeleton** (composition) | How is the section arranged? | `references/compositions/` |
85
+ | **Treatment** | What container language dresses it? (cards, rules, flat blocks, edge-to-edge, open space) | `references/treatments.md` |
86
+ | **Motion** | What happens over time? (Tier 0 none · Tier 1 light presets · Tier 2 choreography) | `layout-motion`, `layout-choreography` skills |
87
+
88
+ Keeping these apart is what lets one library serve marketing, editorial, documentation and expressive work without copies of everything.
89
+
90
+ ## Workflow
91
+
92
+ Follow these steps in order. Output a short plan (step 2–4) before writing code so the choices are visible and correctable.
93
+
94
+ **With the Shavin MCP connected:** call `plan_page({ brief })` — it picks the recipe, lists composition candidates per section with their contracts, sets the default treatment and motion tier, and returns a plan template for steps 2–4. Fill it, save it as `.shavin/plans/<page>.json`, and run `check_page({ plan })` before code. Build every section as `<Section data-composition="<ID>">`; finish with `check_page({ targetDir })`, which checks the code against the plan.
95
+
96
+ 1. **Frame the brief.** Identify the subject, audience, style (structural · marketing · editorial · hybrid · documentation · expressive), the page's job, and the *real* content available: item counts, copy length, real visuals, numbers, quotes, code. If key content is missing, say so and use clearly marked placeholders. Compositions have content contracts, and fake proof (invented numbers, quotes, logos) undermines the page.
97
+ 2. **Pick the section sequence.** Start from the closest recipe in `references/page-recipes.md`, then adjust to the real content.
98
+ 3. **Choose a composition per section** using `references/selection-guide.md`. It works from content signals and has tie-breakers. Then read only those entries in `references/compositions/<family>.md`: honour each entry's `Contract`, `Grid`, `Watch` and `Avoid when`.
99
+ 4. **Choose the treatment** (`references/treatments.md`): one dominant treatment for the page, at most one brand colour. Then **vary**: apply at least two knobs from `references/distinctiveness.md`, and separately name the overline form, interactive-control choice, typographic voice and colour application pattern from `references/component-language.md` — these component-level choices are where output goes generic even when the composition and treatment are varied. Name one bold moment.
100
+ 5. **Read the adapter** for the target stack: `references/adapters/shavin-ui.md` for `@shavin/ui` projects. Never invent component props: check the project's real components.
101
+ 6. **Apply the foundations** in `references/foundations.md`: measure, concentric radii, spacing rhythm, responsive behaviour, accessibility, performance, stress tests.
102
+ 7. **Decide the motion tier.** Default Tier 0 for utility and documentation pages. Add Tier 1 (`layout-motion`) where it helps comprehension or delight. When the brief asks for a premium, award-level, expressive or brand-led page, plan one signature Tier 2 scene (`layout-choreography`, on a composition marked `choreography-ok`, such as F6) plus at most two supporting scenes; a page like that with no signature moment reads as generic. Build Tier 2 only after the static layout is complete. Expose `data-slot` attributes (from each composition's `slots`) so motion can attach without changing the structure.
103
+ 8. **Verify** with the checklist below, then do the **visual review** (`references/visual-review.md`): screenshot the rendered page at 375, 768 and 1280, score it against the rubric, measure contrast, fix and re-check. Passing `check_page` is not a visual review.
104
+
105
+ ## Reference map
106
+
107
+ | When you need… | Read |
108
+ |---|---|
109
+ | To choose compositions | `references/selection-guide.md` |
110
+ | A starting sequence for a page type | `references/page-recipes.md` |
111
+ | The detail of a specific composition | `references/compositions/<family>.md` (families: structural, hero, features, proof, conversion, gallery, editorial, documentation, expressive) |
112
+ | To change how it looks without changing the structure | `references/treatments.md` |
113
+ | To avoid a generic result at the layout level | `references/distinctiveness.md` |
114
+ | To avoid a generic result in typography, labels, controls and colour | `references/component-language.md` |
115
+ | Rules that apply to every section | `references/foundations.md` |
116
+ | To review the rendered page before finishing | `references/visual-review.md` |
117
+ | Code for `@shavin/ui` | `references/adapters/shavin-ui.md` |
118
+ | Code for plain HTML + Tailwind | `references/adapters/tailwind-html.md` |
119
+ | To add or change a composition | `references/metadata-schema.md` and `/add-composition` |
120
+
121
+ Load a family file only when you use one of its IDs. Loading the whole library wastes context.
122
+
123
+ ## Ground rules
124
+
125
+ - **Utility screens use `data-composition="none"`:** auth, 404, settings and dashboards are not marketing compositions; build them with `shavin-app`.
126
+ - **Content contract first.** If the real content doesn't fit a composition's contract (item counts, lengths, required media), change the composition, not the content, and never squeeze it in.
127
+ - **One job per section, one primary action per section.**
128
+ - **Rhythm.** No three consecutive sections with the same grid. Adjacent sections differ in at least one of background, alignment, density, or column count.
129
+ - **Reading order is DOM order.** Reorder visually with CSS only where the composition says so.
130
+ - **Nothing depends on motion or JS.** Content is present and complete with animation off.
131
+ - **Placeholder proof is fine.** Numbers, testimonials, logos and case-study results come from the user. When missing, write fictional ones of your own, never copied from a real site or brand. The user replaces them.
132
+ - **Skeletons, not templates.** Adapt copy, proportions and emphasis to the subject; the compositions are starting structures.
133
+ - **Token purity.** All colours use `@shavin/ui` semantic tokens (`bg-surface`, `text-fg`, `text-fg-subtle`, `border-hairline`). Zero hex/rgb/`--n-*`. Container surfaces use `rounded-[var(--radius-panel)]`; controls use `rounded-[var(--radius-lg)]`. Concentric nesting via `rounded-panel-inner` or `rounded-panel-p5`.
134
+
135
+ ## Verification checklist
136
+
137
+ Before handing work back, confirm:
138
+
139
+ 1. Every section maps to a composition ID (or is a documented deviation) and carries `data-composition="<ID>"` (`"none"` only for utility screens such as auth, 404, settings and dashboards). `check_page({ targetDir })` verifies this.
140
+ 2. Each composition's `Contract` is met by the actual content.
141
+ 3. Mobile order equals reading order; nothing scrolls sideways except dedicated scrollers.
142
+ 4. One `<h1>`, sequential headings, labelled landmarks, visible focus.
143
+ 5. Contrast passes, including text over media.
144
+ 6. Anything that moves for more than 5 seconds can be paused; reduced motion is respected.
145
+ 7. The hero media is loaded eagerly with dimensions set; the rest is lazy; nothing shifts.
146
+ 8. The rhythm rule holds across the page.
147
+ 9. At least two variation knobs were changed from the recipe and one bold moment is named.
148
+ 10. Overline form, interactive-control choice, typographic voice and colour application pattern are each named — not left as whatever the framework's defaults happened to produce.
149
+ 11. Long-headline, missing-image and item-count stress tests pass (`foundations.md` §7).
@@ -0,0 +1,122 @@
1
+ # Adapter: `@shavin/ui`
2
+
3
+ Composition entries are written in neutral terms (section, container, grid, stack, panel, heading…). This file maps them to `@shavin/ui` primitives and tokens.
4
+
5
+ **Source of truth.** Verify prop names and values against the library's own source or docs before relying on one, and never invent a prop. If something isn't listed here, check the package rather than guessing.
6
+
7
+ Contents: 1 Vocabulary map · 2 Conventions · 3 Tokens · 4 Treatment recipes · 4b Media backgrounds · 5 Concentric radius · 6 Component language · 7 Verify before use
8
+
9
+ ---
10
+
11
+ ## 1. Vocabulary map
12
+
13
+ | Neutral term | `@shavin/ui` | Notes |
14
+ |---|---|---|
15
+ | section | `<Section size="…">` | role sizes `"strip"`, `"body"`, `"hero"`, `"compact"` (see `foundations.md` §3) |
16
+ | container | `<Container size="…">` | sizes `"2"` (single-card plan), `"3"` (CTA), `"4"` (hero) |
17
+ | grid | `<Grid columns="…" stack="auto" gap="…">` | `columns="3" stack="auto"`, `gap="6"`, `gap="12"` |
18
+ | stack / row | `<Flex direction align justify gap>` | `direction="column"`, `align="center"`, `justify="between"` |
19
+ | panel | `<Card>` | `className="p-6"` etc. |
20
+ | heading / body | `<Heading size>` · `<Text size>` | marketing and agency hero `size="4xl"` (fluid 36→60px); `size="5xl"` (36→72px) only for the type-only hero H5 or a headline of four words or fewer; at 1440px the hero title is at most twice the size of a section title (`3xl`, 36→48px); a wide display font reads larger than Inter at the same size, so use `4xl` when the display font is not the body font; section `size="3xl"` (36→48px), `size="2xl"` (30→36px); no `md:text-*` steps. All Headings apply `text-balance` |
21
+ | button | `<Button size variant>` | `size="lg"`, variants `"ghost"`, `"outline"` |
22
+ | tabs | `<Tabs defaultValue>` `<TabsList>` `<TabsContent>` | F5, G2 |
23
+ | accordion | `<Accordion type="single" collapsible>` `<AccordionItem>` | Q2 |
24
+ | avatar | `<Avatar size="md">` | T1, T2 |
25
+ | table | `<Table>` `<TableRow>` | P2 |
26
+ | segmented filter | `<SegmentedControl>` | G2 |
27
+ | badge / chip | `<Badge variant="…">` | overlines, status — verify variants against source; don't default to it for every overline (see `component-language.md` §1) |
28
+ | preview frame | `BrowserFrame` (mentioned in H1) | verify it exists |
29
+
30
+ ## 2. Conventions
31
+
32
+ 1. **Equal-column grids use `<Grid columns="…" stack="auto">`**, always: `stack="auto"` collapses 3+ columns → 2 on tablet → 1 on mobile, and 2 columns → 1 on mobile. Never pass a bare `columns` without `stack` on a multi-column layout (a fixed count applies at every width, so three columns on a phone), and don't hand-write `md:grid-cols-*` breakpoint classes on `<Grid>`.
33
+ 2. **Span-based layouts use plain Tailwind on a `<div>`**: `grid grid-cols-1 md:grid-cols-6 lg:grid-cols-12` plus `col-span-*`. This covers F2, H3, E3, D-shells and anything with unequal columns. Don't mix `<Grid columns={12}>` with Tailwind span classes.
34
+ 3. **Use a raw `<section className="relative …">`** (instead of `<Section>`) only for full-bleed compositions (H4, C3) and expressive ones (X*) where the container semantics fight the layout. Keep landmarks and `aria-labelledby` on it.
35
+ 4. **Measure** uses `ch` (see `foundations.md`): `max-w-[68ch]`. `max-w-2xl` is only the fallback.
36
+ 5. **Slots** are exposed as `data-slot="headline"` etc. on the elements named in each composition's `slots` metadata, so Tier 1/2 motion can attach.
37
+ 6. **Concentric radius**: use `radius="concentric"` on any nested component inside a padded panel. For manual control, use `rounded-panel-inner`, `rounded-panel-p3`, or `rounded-panel-p5` utilities.
38
+ 7. **Component language** (overline form, tabs vs. buttons, typographic voice, colour application) is decided per page from `component-language.md` before reaching for `@shavin/ui` primitives — don't let `<Badge>` become the reflex overline or `<Button>` the reflex control for every choice.
39
+
40
+ ## 3. Tokens
41
+
42
+ | Purpose | Token / class |
43
+ |---|---|
44
+ | Page background | `bg-canvas` |
45
+ | Subtle inset background | `bg-canvas-subtle` |
46
+ | Panel surface | `bg-surface` |
47
+ | Primary text | `text-fg` |
48
+ | Secondary text | `text-fg-subtle` |
49
+ | Hairline border | `border-hairline`, `divide-hairline` |
50
+ | Brand | `text-brand-text`, `bg-brand-solid text-brand-fg` (fill under text), `border-brand-text` (state border) |
51
+ | Panel radius (outer) | `rounded-[var(--radius-panel)]` |
52
+ | Control radius | `rounded-[var(--radius-lg)]` |
53
+ | Panel radius (inner, concentric) | `rounded-panel-inner` |
54
+ | Concentric with specific padding | `rounded-panel-p3`, `rounded-panel-p5` |
55
+ | Panel shadow | `shadow-panel` |
56
+ | Motion duration | `duration-instant`, `duration-fast`, `duration-base`, `duration-slow`, `duration-enter` |
57
+ | Utilities | `no-scrollbar`, `animate-marquee` |
58
+
59
+ Use tokens for every colour so dark mode and re-theming work. Don't hard-code hex values in compositions. Never use `--n-*` foundation tokens outside `global.css`.
60
+
61
+ ## 4. Treatment recipes
62
+
63
+ | Treatment | Class recipe (starting point) |
64
+ |---|---|
65
+ | carded | `<Card className="p-6">` (`bg-surface border-hairline rounded-[var(--radius-panel)]`), media in `rounded-panel-inner bg-canvas-subtle` |
66
+ | ruled | No `<Card>`. Items: `border-t border-hairline pt-6`. Columns: `divide-x divide-hairline` with padding on items. **Label column must use a fixed width** (`sm:w-72 shrink-0`) so descriptions align across rows — never `grid-cols-[auto_1fr]` or bare `shrink-0` without a width |
67
+ | flat | `<div className="bg-canvas-subtle rounded-[var(--radius-panel)] p-6">`, no border, no shadow |
68
+ | full-bleed | Raw `<section>`, media absolutely positioned, scrim layer, content in `<Container>` |
69
+ | open | No container; use type scale and `gap` for structure |
70
+
71
+ ## 4b. Media backgrounds
72
+
73
+ `Section`, `Grid`, `Flex`, `Box`, `Container`, and `Card` accept layout bg props. Use them for hero / main media instead of hand-rolled absolute layers.
74
+
75
+ | Prop | Use |
76
+ |---|---|
77
+ | `bgImage` | Curated Lummi (`assets.lummi.ai`) / Unsplash / user photo |
78
+ | `bgVideo` + `bgPoster` | Pexels loop; `bgPoster` is the poster and the reduced-motion static fallback |
79
+ | `bgOverlays` | Comma-separated stack, e.g. `"scrim-left, dark-20"` |
80
+ | `surface` | `"dark-always"` / `"light-always"` on the media container so text doesn't flip with page theme |
81
+
82
+ **Overlay presets:** `mesh-lime`, `mesh-night`, `mesh-mint`, `mesh-peach` (fixed pastel palettes), `mesh-brand` (theme brand); append `-animated` for slow drift that stops under reduced motion (`bgOverlays="mesh-lime-animated, dark-20"`). `scrim-left` = directional scrim for left-aligned copy over media; `fade-canvas` = theme-aware dissolve into the page. Off-centre radial: `radial(at 20% 30%, #8b5cf699/0%, #8b5cf600/45%)`; 8-digit hex alpha works in overlay colours.
83
+
84
+ **On-media text:** on dark media use `text-fg` for headings and `text-fg-muted` (not `text-fg-subtle`, too faint over media) for subtitles/overlines. Off media the `text-fg-subtle` subtitle rule stands.
85
+
86
+ ```tsx
87
+ <Section size="hero" surface="dark-always" bgImage="https://assets.lummi.ai/…" bgOverlays="scrim-left, dark-20">
88
+ <Container size="4">
89
+ <Heading size="5xl">Headline</Heading>
90
+ <Text className="text-fg-muted">Subtitle over media.</Text>
91
+ </Container>
92
+ </Section>
93
+ ```
94
+
95
+ ## 5. Concentric radius
96
+
97
+ `@shavin/ui` implements concentric radii at the foundation level. The formula: `R_inner = max(floor, R_outer - P)` with `floor = min(radius-lg, radius-panel / 2)` — padded children never collapse to square corners (only a 0-radius theme yields 0).
98
+
99
+ - **Automatic**: set `radius="concentric"` on any component — it walks up the tree to find the nearest ancestor with a radius + padding value and auto-computes the inner radius.
100
+ - **Manual utilities**: `rounded-panel-inner` (fallback: the plain `--radius-panel`, no subtraction), `rounded-panel-p3` (assumes p-3 = 12px), `rounded-panel-p5` (assumes p-5 = 20px).
101
+ - **Fallback**: if no ancestor has radius or padding, the theme's default radius is used and a warning is surfaced.
102
+
103
+ Never give parent and child the same radius when padding is non-zero. Container surfaces always use `rounded-[var(--radius-panel)]`; controls use `rounded-[var(--radius-lg)]`.
104
+
105
+ ## 6. Component language
106
+
107
+ `component-language.md` governs the four repeated micro-choices (overline form, interactive control, typographic voice, colour application) that compound across every section. Decide these per page before reaching for primitives:
108
+
109
+ - **Overline:** don't reflex `<Badge>` for every eyebrow — plain small-caps label, rule+label, numeral, icon+label, or none are all valid, and none is the usual choice; use a label only where it adds information (`component-language.md` §1).
110
+ - **Controls:** `<Button>` is for a single action; use `<Tabs>`/`<SegmentedControl>` for 2–5 mutually exclusive views of the same content (`component-language.md` §2).
111
+ - **Type voice:** decide weight contrast, family pairing, and scale ratio per page — don't default to the last project's choice (`component-language.md` §3).
112
+ - **Colour application:** name a pattern (single brand, duotone, per-section rotation, monochrome+break, gradient ground) — don't reach for the same brand at the same opacity everywhere (`component-language.md` §4).
113
+
114
+ ## 7. Verify before use
115
+
116
+ Confirm in the package source:
117
+
118
+ - What pixel widths `Container size` values map to (and whether `"1"` and larger than `"4"` exist).
119
+ - `Grid` `columns` is a string variant `"1"`–`"6"` with `stack` (`none` | `auto` | `mobile` | `tablet`); it does not take responsive objects or `columns={12}`.
120
+ - The valid `Heading`/`Text` size scale.
121
+ - `Section size` role values (`compact`, `strip`, `body`, `hero`) against `Section.tsx` before use.
122
+ - The `Table` sub-components beyond `Table` and `TableRow`.
@@ -0,0 +1,100 @@
1
+ # Adapter: semantic HTML + Tailwind (generic)
2
+
3
+ Plain HTML reference: the token contract and DOM structure behind the compositions. Not a supported target: Shavin projects use `@shavin/ui` on Next.js or Vite.
4
+
5
+ Contents: 1 Token contract · 2 Building blocks · 3 Measure and type utilities · 4 Treatment recipes
6
+
7
+ ---
8
+
9
+ ## 1. Token contract
10
+
11
+ Define semantic tokens once; components use only these, so dark mode and re-theming work everywhere.
12
+
13
+ ```css
14
+ :root {
15
+ --canvas: #ffffff;
16
+ --canvas-subtle: #f6f6f7;
17
+ --surface: #ffffff;
18
+ --fg: #111114;
19
+ --fg-subtle: #5b5b66;
20
+ --hairline: #e4e4e8;
21
+ --brand: #3b5bdb;
22
+
23
+ --radius-panel: 20px;
24
+ --panel-pad: 24px;
25
+ --shadow-panel: 0 1px 2px rgb(0 0 0 / .06), 0 8px 24px rgb(0 0 0 / .06);
26
+
27
+ --section-y: clamp(4rem, 8vw, 6rem); /* default */
28
+ --section-y-compact: clamp(2.5rem, 5vw, 3.5rem);
29
+ --section-y-spacious: clamp(6rem, 12vw, 9rem);
30
+ --measure-body: 68ch;
31
+ --container: 72rem;
32
+ }
33
+ @media (prefers-color-scheme: dark) {
34
+ :root:not([data-theme="light"]) {
35
+ --canvas: #0e0e11; --canvas-subtle: #16161b; --surface: #16161b;
36
+ --fg: #f2f2f5; --fg-subtle: #a0a0ad; --hairline: #2a2a33;
37
+ }
38
+ }
39
+ :root[data-theme="dark"] {
40
+ --canvas: #0e0e11; --canvas-subtle: #16161b; --surface: #16161b;
41
+ --fg: #f2f2f5; --fg-subtle: #a0a0ad; --hairline: #2a2a33;
42
+ }
43
+ ```
44
+
45
+ The values are placeholders: replace them with the project's palette. The names are the contract.
46
+
47
+ ## 2. Building blocks
48
+
49
+ ```html
50
+ <!-- section with rhythm, container, labelled heading -->
51
+ <section aria-labelledby="features-h" style="padding-block: var(--section-y)">
52
+ <div class="mx-auto w-full max-w-[var(--container)] px-6">
53
+ <h2 id="features-h" data-slot="headline" class="text-balance">…</h2>
54
+ <p data-slot="sub" class="max-w-[58ch] text-[var(--fg-subtle)]">…</p>
55
+ <!-- composition grid here -->
56
+ </div>
57
+ </section>
58
+ ```
59
+
60
+ Equal columns:
61
+
62
+ ```html
63
+ <div class="grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3">…</div>
64
+ ```
65
+
66
+ Span layout (F2, H3, E3):
67
+
68
+ ```html
69
+ <div class="grid grid-cols-1 gap-6 md:grid-cols-6 lg:grid-cols-12">
70
+ <article class="md:col-span-6 lg:col-span-8">…</article>
71
+ <article class="md:col-span-3 lg:col-span-4">…</article>
72
+ </div>
73
+ ```
74
+
75
+ Full-screen sections use `min-h-[85svh]`, never `vh`.
76
+
77
+ ## 3. Measure and type utilities
78
+
79
+ | Need | Class |
80
+ |---|---|
81
+ | Body measure | `max-w-[68ch]` |
82
+ | Lead measure | `max-w-[58ch]` |
83
+ | Balanced headline | `text-balance` |
84
+ | Orphan-safe body | `[text-wrap:pretty]` |
85
+ | Tabular figures | `tabular-nums` |
86
+ | Fluid display type | `text-[clamp(3rem,9vw,9rem)] leading-[0.95]` |
87
+
88
+ Logical properties for RTL: `ps-*`, `pe-*`, `ms-*`, `me-*`, `text-start`, `text-end`.
89
+
90
+ ## 4. Treatment recipes
91
+
92
+ | Treatment | Recipe |
93
+ |---|---|
94
+ | carded | `bg-[var(--surface)] border border-[var(--hairline)] rounded-[var(--radius-panel)] p-6` |
95
+ | ruled | `border-t border-[var(--hairline)] pt-6` on items; `divide-x divide-[var(--hairline)]` on columns |
96
+ | flat | `bg-[var(--canvas-subtle)] rounded-[var(--radius-panel)] p-6` |
97
+ | full-bleed | `relative min-h-[85svh] overflow-hidden`, media `absolute inset-0 object-cover`, scrim `absolute inset-0 bg-gradient-to-t from-black/60`, content `relative` |
98
+ | open | No container classes; structure via type scale, `gap-*` and whitespace |
99
+
100
+ Concentric inner radius: `rounded-[max(calc(var(--radius-panel)-var(--panel-pad)),4px)]`.
@@ -0,0 +1,105 @@
1
+ # Component language: typography, labels, controls, colour
2
+
3
+ `treatments.md` decides the *container* (cards, rules, flat, full-bleed, open). This file decides
4
+ the smaller, more frequent choices inside that container — the ones that get repeated across every
5
+ section of a page, so a bad default here compounds far more than a bad default at the composition
6
+ level. If every hero uses a pill badge for its overline, every parallel-option section uses buttons,
7
+ and every brand is the same shade at the same opacity, the page reads as templated even when the
8
+ compositions themselves are varied. These choices are decisions per page, not defaults per project:
9
+ re-decide them for each brief the way `distinctiveness.md` re-decides layout knobs.
10
+
11
+ Contents: 1 Overline / eyebrow · 2 Interactive control choice · 3 Typographic voice · 4 Colour application · 5 Per-page checklist
12
+
13
+ ---
14
+
15
+ ## 1. Overline / eyebrow
16
+
17
+ The small element above a headline (category, status, kicker). A pill badge is one option, not the
18
+ default — reaching for it every time is the single most common tell in this library's own audit. The same goes for any label: reaching for one on every section is a tell too.
19
+
20
+ | Form | Looks like | Best for | Avoid when |
21
+ |---|---|---|---|
22
+ | **Chip/badge** | Rounded pill, filled or outlined, small caps or sentence case | Status, category, "New", version tags — things that are genuinely a label on the content | Every hero on the page has one; it stops reading as information and starts reading as decoration |
23
+ | **Plain small-caps label** | Uppercase, letter-spaced, no container | Editorial, documentation; quiet framing that doesn't compete with the headline | The brand voice is loud/expressive — a bare label under-commits |
24
+ | **Rule + label** | A short horizontal rule or tick mark beside the label | Ruled/open treatments; ties the label to the section's dividing language | Carded treatment (mismatched container language) |
25
+ | **Numeral / marker** | `01`, `§`, a bullet glyph | Sequences, indexes, archive lists (E4, F7) | The content isn't actually ordered — don't imply sequence that doesn't exist |
26
+ | **Icon + label** | Small icon, then text, no container | When the icon adds real information (a category glyph), not as decoration | The icon is generic (a sparkle, an arrow) and could be removed with no loss |
27
+ | **None** | Headline stands alone | Type-led heroes (H5), statement sections, when the headline is already self-explanatory | Reflex omission when a genuine category/status exists and readers would benefit from it |
28
+
29
+ **Rule:** an overline is optional, and "None" is the default for a section whose heading already says it. Where one is used, pick one primary form for the page. A second form is allowed only where it
30
+ carries a different *kind* of meaning (e.g. chips for status badges in a feature grid, plain label
31
+ for section eyebrows) — never two forms doing the same job on the same page. Use a label on at most one section or region per page view, never on every section.
32
+
33
+ ## 2. Interactive control choice
34
+
35
+ The most common repetitive tell after overlines: reaching for a button where the content is
36
+ actually a set of parallel, mutually exclusive options (which wants tabs or a segmented control),
37
+ or reaching for tabs where a single action was needed (which wants a button).
38
+
39
+ | Content shape | Use | Not |
40
+ |---|---|---|
41
+ | One action, one destination | Button | Tabs (there's nothing to switch between) |
42
+ | 2–5 mutually exclusive views of the *same* content (F5, personas, modes) | Tabs (ARIA tabs pattern) or `SegmentedControl` for ≤ 4 short labels | A row of buttons that each navigate away — that's navigation, not a view switch |
43
+ | A short, exclusive either/or toggle (billing period, unit system) | `SegmentedControl` | A dropdown (overkill for 2–3 options) or a checkbox (implies non-exclusive) |
44
+ | Several independent, non-exclusive actions in a row | Buttons, one primary + ghost/outline secondaries | Tabs (implies exclusivity that isn't real) |
45
+ | A long list of destinations (nav, footer, index) | Plain links | Buttons for every link (visually shouts; dilutes the real primary action) |
46
+ | Expand/collapse one section at a time | Accordion | Tabs pretending to be an accordion on mobile without actually becoming one |
47
+
48
+ **Rule:** before placing a button, ask whether the reader is choosing an action or switching a
49
+ view. Wrong control choice is the more common failure than wrong container styling — it's also an
50
+ accessibility issue (a `<button>` implementing tab behaviour with the mouse but not the keyboard
51
+ fails the ARIA tabs pattern in `foundations.md` §5).
52
+
53
+ ## 3. Typographic voice
54
+
55
+ `foundations.md` §1 sets measure; this sets *personality*. Pick one voice deliberately per page —
56
+ don't default to whatever the last project used.
57
+
58
+ | Voice | Recipe | Reads as |
59
+ |---|---|---|
60
+ | **Single family, weight contrast** | One typeface throughout; personality comes entirely from weight (400 body / 700–900 display) and size ratio | Calm, product-led, SaaS |
61
+ | **Two contrasting families** | A display face for headlines (serif, condensed, or expressive) + a plain grotesk for body/UI | Editorial, brand-led, publications |
62
+ | **Mono brand** | Primary family for prose, monospace for anything data/code/technical (values, labels, timestamps) | Developer tools, technical credibility |
63
+ | **Fluid oversized display** | One display face pushed to extreme scale (`clamp()`), minimal body copy elsewhere | Expressive, manifesto, campaign (X2, H5) |
64
+
65
+ **Contrast ratio matters more than family choice.** A 1.25 body-to-display ratio reads as quiet and
66
+ consistent; 2×+ reads as loud and editorial (see `distinctiveness.md`'s scale-contrast knob — this
67
+ is the typographic half of that knob, made concrete). Decide the ratio once per page and hold it:
68
+ mixing a subtle ratio in the hero with an extreme one in a feature section reads as indecision, not
69
+ range.
70
+
71
+ **Watch:** don't let "two contrasting families" become three. Don't use the display face for body
72
+ copy at small sizes (most display faces lose legibility below ~18px). If the design system ships
73
+ only one family, the knob becomes weight contrast and scale — still a real choice, not an excuse to
74
+ skip this section.
75
+
76
+ ## 4. Colour application
77
+
78
+ Tokens (`shavin-ui.md` §3) fix *which* colours exist. This decides how the brand gets *used*
79
+ across a page — the part that most often defaults to "the same brand, same opacity, every time."
80
+
81
+ | Pattern | How it works | Reads as |
82
+ |---|---|---|
83
+ | **Single brand, sparing** | One brand colour, used only for the primary CTA and one other moment (a chip, a link) | Restrained, product-led |
84
+ | **Duotone** | Two brand colours, each with a defined job (e.g. one for status/proof, one for action) — never both in the same element | Considered, slightly more expressive |
85
+ | **Per-section rotation** | A muted palette rotates across card backgrounds or testimonial cards (see T2, M6-style scroll strips) so no two adjacent items share a colour | Editorial, playful, brand-led |
86
+ | **Monochrome + one break** | Page is entirely neutral (ink/paper) except one deliberately-coloured moment — the single bold moment from `distinctiveness.md` §3 | Quiet, confident, expressive |
87
+ | **Gradient as ground** | Colour lives in a background treatment (hero, CTA), not in individual UI elements, which stay neutral on top of it | Cinematic, full-bleed sections (H4, C3) |
88
+
89
+ **Rule:** name the pattern before building, the same way you name compositions and treatments. If
90
+ every section reaches for the identical brand at the identical weight, that's the tell — pick one
91
+ pattern above and let it justify *why* an element is coloured, not just fill in the brand colour
92
+ wherever there's a button.
93
+
94
+ ## 5. Per-page checklist
95
+
96
+ Add to the distinctiveness process (`distinctiveness.md` §5) before building:
97
+
98
+ 1. Name the overline form for the page (and any second form, with its distinct job).
99
+ 2. For every place a control was about to become a button, ask: action or view-switch? Correct any
100
+ tabs-that-should-be-buttons or buttons-that-should-be-tabs.
101
+ 3. Name the typographic voice and its scale-contrast ratio.
102
+ 4. Name the colour application pattern.
103
+ 5. Run the sameness test (`distinctiveness.md` §1) again with these four named — a page can pass
104
+ the layout-level sameness test and still fail here if every component choice defaults to the
105
+ safest option.