@contentrain/astro-kit 0.29.4 → 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.
Files changed (39) hide show
  1. package/README.md +25 -2
  2. package/catalog.json +1055 -7
  3. package/components/_shared/KitImage.astro +6 -4
  4. package/components/_shared/Section.astro +18 -3
  5. package/components/_shared/measured.ts +142 -0
  6. package/components/_shared/types.ts +40 -0
  7. package/components/band/Band.astro +132 -0
  8. package/components/band/fixtures.json +8 -0
  9. package/components/band/meta.json +323 -0
  10. package/components/card-grid/CardGrid.astro +7 -3
  11. package/components/card-grid/fixtures.json +2 -1
  12. package/components/card-grid/meta.json +111 -0
  13. package/components/contact-details/ContactDetails.astro +7 -2
  14. package/components/contact-details/meta.json +113 -1
  15. package/components/contact-form/meta.json +1 -1
  16. package/components/cta/meta.json +1 -1
  17. package/components/faq/meta.json +1 -1
  18. package/components/feature-list/FeatureList.astro +7 -3
  19. package/components/feature-list/fixtures.json +2 -1
  20. package/components/feature-list/meta.json +113 -1
  21. package/components/gallery/meta.json +1 -1
  22. package/components/hero/Hero.astro +14 -8
  23. package/components/hero/fixtures.json +2 -1
  24. package/components/hero/meta.json +111 -0
  25. package/components/logo-cloud/meta.json +1 -0
  26. package/components/nav/Nav.astro +7 -1
  27. package/components/newsletter/Newsletter.astro +5 -1
  28. package/components/newsletter/meta.json +113 -1
  29. package/components/post-card/PostCard.astro +9 -2
  30. package/components/post-card/meta.json +4 -1
  31. package/components/pricing/meta.json +1 -0
  32. package/components/split/meta.json +1 -0
  33. package/components/stats/meta.json +3 -1
  34. package/components/steps/meta.json +1 -0
  35. package/components/tabs/Tabs.astro +5 -2
  36. package/components/tabs/meta.json +2 -1
  37. package/components/team/meta.json +1 -0
  38. package/components/testimonial/meta.json +1 -0
  39. package/package.json +2 -2
@@ -8,6 +8,7 @@
8
8
  "Button.astro",
9
9
  "KitImage.astro",
10
10
  "Section.astro",
11
+ "measured.ts",
11
12
  "types.ts"
12
13
  ],
13
14
  "variants": {
@@ -5,7 +5,9 @@
5
5
  "category": "section",
6
6
  "uses": [],
7
7
  "shared": [
8
- "Section.astro"
8
+ "Section.astro",
9
+ "measured.ts",
10
+ "types.ts"
9
11
  ],
10
12
  "variants": {
11
13
  "columns": {
@@ -8,6 +8,7 @@
8
8
  "KitImage.astro",
9
9
  "Section.astro",
10
10
  "image.ts",
11
+ "measured.ts",
11
12
  "types.ts"
12
13
  ],
13
14
  "variants": {
@@ -5,6 +5,7 @@
5
5
  // the same markup into tabs.
6
6
  import { tv } from 'tailwind-variants'
7
7
  import Section from '../_shared/Section.astro'
8
+ import type { MeasuredStyle } from '../_shared/types'
8
9
 
9
10
  export interface TabItem {
10
11
  label: string
@@ -47,9 +48,11 @@ interface Props {
47
48
  orientation?: 'horizontal' | 'vertical' | undefined
48
49
  tone?: 'default' | 'muted' | 'inverse' | 'accent' | undefined
49
50
  id?: string | undefined
51
+ /** The source section's measured style (`MeasuredStyle`): frame, padding, fill, background image, columns per width, gap. Absent, the site's tokens; present, it wins over tone and columns. */
52
+ measured?: MeasuredStyle | undefined
50
53
  }
51
54
 
52
- const { items, heading, label, style, orientation = 'horizontal', tone, id = 'tabs' } = Astro.props
55
+ const { items, heading, label, style, orientation = 'horizontal', tone, id = 'tabs', measured } = Astro.props
53
56
  const s = tabs({ style, orientation, tone })
54
57
  const headingId = heading ? `${id}-title` : undefined
55
58
  // One level under the section heading, or the section's heading when there is none.
@@ -57,7 +60,7 @@ const PanelHeading = heading ? 'h3' : 'h2'
57
60
  const value = (i: number) => `tab-${i + 1}`
58
61
  ---
59
62
  {items.length > 0 && (
60
- <Section tone={tone} spacing="md" id={id} aria-labelledby={headingId}>
63
+ <Section measured={measured} tone={tone} spacing="md" id={id} aria-labelledby={headingId}>
61
64
  {heading && <h2 id={headingId} class={s.heading()}>{heading}</h2>}
62
65
  <div class={s.root()} data-kit-tabs={id} data-orientation={orientation} data-label={label ?? heading ?? undefined}>
63
66
  <div class={s.list()} data-part="list">
@@ -4,13 +4,14 @@
4
4
  "description": "Tabbed panels with the WAI-ARIA tabs pattern from Zag.js (arrow keys, Home/End, roving focus). Without script every panel shows in turn under its own title, so no content is ever hidden from a reader or a crawler.",
5
5
  "category": "content",
6
6
  "uses": [],
7
- "shared": ["Section.astro"],
7
+ "shared": ["Section.astro", "measured.ts", "types.ts"],
8
8
  "variants": {
9
9
  "style": { "options": ["underline", "pills"], "default": "underline", "description": "underline: a rule under the list, the selected tab underlined in accent. pills: the selected tab filled with accent." },
10
10
  "orientation": { "options": ["horizontal", "vertical"], "default": "horizontal", "description": "vertical: the tab list beside the panel on wide screens (Elementor vertical tabs)." },
11
11
  "tone": { "options": ["default", "muted", "inverse", "accent"], "default": "default", "description": "Section background." }
12
12
  },
13
13
  "props": {
14
+ "measured": {"type": "object", "content": false, "description": "The source section's measured style (MeasuredStyle): frame width, padding, fill, image, columns per width, gap, text tone, radius, minimum height — all in pixels. Absent, the site's tokens; present, it wins over tone and columns. Values that are not a number, a colour or a known keyword are dropped.", "fields": {"containerPx": {"type": "integer", "min": 0, "max": 2560, "description": "The frame's content width."}, "padY": {"type": "integer", "min": 0, "max": 400, "description": "Top and bottom padding."}, "padX": {"type": "integer", "min": 0, "max": 200, "description": "The frame's side padding (gutter)."}, "bg": {"type": "object", "description": "The section's background.", "fields": {"color": {"type": "string", "description": "Fill colour: hex, rgb(a) or hsl(a)."}, "image": {"type": "string", "description": "Background image address (http(s) or root-relative), drawn behind the content."}, "overlay": {"type": "string", "description": "Colour or linear/radial gradient laid over the image or the fill."}, "size": {"type": "string", "description": "cover, contain or auto; anything else draws as cover."}, "position": {"type": "string", "description": "One or two of center/top/bottom/left/right or percentages."}}}, "columns": {"type": "object", "description": "Item columns at 390 (base), 768 (md) and 1280 (lg) px; a missing width follows the narrower one.", "fields": {"390": {"type": "integer", "min": 1, "max": 6, "description": "Phone."}, "768": {"type": "integer", "min": 1, "max": 6, "description": "Tablet."}, "1280": {"type": "integer", "min": 1, "max": 6, "description": "Desktop."}}}, "gap": {"type": "integer", "min": 0, "max": 200, "description": "Gap between items."}, "tone": {"type": "select", "options": ["light", "dark"], "description": "What the text is set for: dark = light text on a dark band. Without it, a fill's own lightness decides."}, "align": {"type": "select", "options": ["start", "center", "end"], "description": "Where the heading and lead sit; read by a component whose own align is not set."}, "radius": {"type": "integer", "min": 0, "max": 200, "description": "Card and item corner radius."}, "minHeight": {"type": "integer", "min": 0, "max": 2000, "description": "The section's minimum height."}}},
14
15
  "items": { "type": "array", "required": true, "items": { "type": "object", "fields": { "label": { "type": "string", "required": true }, "content": { "type": "richtext", "required": true } } }, "description": "Tabs in order (Elementor tabs tab_title/tab_content, Divi tab title + content)." },
15
16
  "heading": { "type": "string", "description": "Section heading; also names the tab list." },
16
17
  "label": { "type": "string", "description": "Accessible name of the tab list when there is no heading." },
@@ -8,6 +8,7 @@
8
8
  "KitImage.astro",
9
9
  "Section.astro",
10
10
  "image.ts",
11
+ "measured.ts",
11
12
  "types.ts"
12
13
  ],
13
14
  "variants": {
@@ -8,6 +8,7 @@
8
8
  "KitImage.astro",
9
9
  "Section.astro",
10
10
  "image.ts",
11
+ "measured.ts",
11
12
  "types.ts"
12
13
  ],
13
14
  "variants": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentrain/astro-kit",
3
- "version": "0.29.4",
3
+ "version": "0.31.0",
4
4
  "license": "MIT",
5
5
  "description": "Copy-in Astro components for Contentrain sites (shadcn model): typed props, tailwind-variants, zero JavaScript by default — with a machine-readable catalog",
6
6
  "type": "module",
@@ -42,7 +42,7 @@
42
42
  "mapping"
43
43
  ],
44
44
  "dependencies": {
45
- "@contentrain/types": "1.57.0"
45
+ "@contentrain/types": "1.59.0"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/node": "^22.10.0",