@contentrain/astro-kit 0.30.0 → 0.31.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.
- package/README.md +25 -2
- package/catalog.json +1043 -7
- package/components/_shared/Section.astro +18 -3
- package/components/_shared/measured.ts +142 -0
- package/components/_shared/types.ts +40 -0
- package/components/band/Band.astro +132 -0
- package/components/band/fixtures.json +8 -0
- package/components/band/meta.json +323 -0
- package/components/card-grid/CardGrid.astro +7 -3
- package/components/card-grid/fixtures.json +2 -1
- package/components/card-grid/meta.json +111 -0
- package/components/contact-details/ContactDetails.astro +7 -2
- package/components/contact-details/meta.json +113 -1
- package/components/contact-form/meta.json +1 -1
- package/components/cta/meta.json +1 -1
- package/components/faq/meta.json +1 -1
- package/components/feature-list/FeatureList.astro +7 -3
- package/components/feature-list/fixtures.json +2 -1
- package/components/feature-list/meta.json +113 -1
- package/components/gallery/meta.json +1 -1
- package/components/hero/Hero.astro +14 -8
- package/components/hero/fixtures.json +2 -1
- package/components/hero/meta.json +111 -0
- package/components/logo-cloud/meta.json +1 -0
- package/components/newsletter/Newsletter.astro +5 -1
- package/components/newsletter/meta.json +113 -1
- package/components/pricing/meta.json +1 -0
- package/components/split/meta.json +1 -0
- package/components/stats/meta.json +3 -1
- package/components/steps/meta.json +1 -0
- package/components/tabs/Tabs.astro +5 -2
- package/components/tabs/meta.json +2 -1
- package/components/team/meta.json +1 -0
- package/components/testimonial/meta.json +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -31,6 +31,7 @@ They read its design tokens and pass its gates: `astro check` with the
|
|
|
31
31
|
| `embed` | Video, map or player loaded on click; a provider link until then (YouTube via nocookie) | a few lines, no dependency |
|
|
32
32
|
| `pagination` | WordPress-style `/page/N/` links | none |
|
|
33
33
|
| `breadcrumb` | Ancestors, then the current page, optional JSON-LD | none |
|
|
34
|
+
| `band` | The styled fallback section: heading, lead, image, a grid of items (figure, title, detail, text, points, link) and buttons, in the measured frame | none |
|
|
34
35
|
|
|
35
36
|
Each component lives in `components/<id>/`:
|
|
36
37
|
|
|
@@ -38,8 +39,30 @@ Each component lives in `components/<id>/`:
|
|
|
38
39
|
- `meta.json`: its catalog entry. Props are Contentrain `FieldDef`s with a description; the entry also lists variants, slots, JavaScript, npm dependencies, `sources` (the builder elements it replaces) and accessibility notes.
|
|
39
40
|
- `fixtures.json`: the visual-regression cases. Every variant option is covered.
|
|
40
41
|
|
|
41
|
-
`components/_shared/` holds `Section`, `Button`, `KitImage` and the value types
|
|
42
|
-
(`ImageInput`, `LinkInput`, `ActionInput`, `NavItem`).
|
|
42
|
+
`components/_shared/` holds `Section`, `Button`, `KitImage`, `measured.ts` and the value types
|
|
43
|
+
(`ImageInput`, `LinkInput`, `ActionInput`, `NavItem`, `MeasuredStyle`).
|
|
44
|
+
|
|
45
|
+
## Measured style
|
|
46
|
+
|
|
47
|
+
A migration can hand a section the style it measured on the source page:
|
|
48
|
+
`measured: MeasuredStyle` (the same fields as `MeasuredStyle` in
|
|
49
|
+
`@contentrain/types`): the frame's width (`containerPx`), padding (`padY`,
|
|
50
|
+
`padX`), the background (`bg.color`, `bg.image` with `overlay`, `size`,
|
|
51
|
+
`position`), item columns at 390, 768 and 1280 px (the kit's base, `md` and
|
|
52
|
+
`lg`; a missing width follows the narrower one), the item `gap`, the text
|
|
53
|
+
`tone` (`dark` = light text on a dark band; without it a fill's own lightness
|
|
54
|
+
decides), the card `radius` and a `minHeight`.
|
|
55
|
+
|
|
56
|
+
Absent, a section takes the site's tokens as before. Present, it wins over
|
|
57
|
+
the `tone` and `columns` variants. `Section` turns it into inline custom
|
|
58
|
+
properties (`--kit-cols-390/768/1280`, `--kit-gap`, `--radius-card`,
|
|
59
|
+
`--container-page`, `--spacing-gutter`) and the section's own padding,
|
|
60
|
+
height and fill; a component's item grid reads them through
|
|
61
|
+
`measuredGrid(measured)`. Every value is checked first
|
|
62
|
+
(`components/_shared/measured.ts`): a number out of range, a colour that is
|
|
63
|
+
not hex, rgb(a) or hsl(a), an image address that is not http(s) or
|
|
64
|
+
root-relative, or a position outside its keywords is dropped, never written
|
|
65
|
+
into a style attribute.
|
|
43
66
|
|
|
44
67
|
## Tokens
|
|
45
68
|
|