@contentrain/astro-kit 0.45.7 → 0.45.8

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.
@@ -1,12 +1,15 @@
1
1
  ---
2
2
  // A link drawn as a button — the kit's call-to-action primitive. Actions in
3
- // migrated content are links, so this is always an <a>.
3
+ // migrated content are links, so this is always an <a>. A label never widens
4
+ // the page: the button is at most as wide as its row, and a label with no
5
+ // break in it (a raw URL) wraps inside it. The label's own box breaks only
6
+ // where it overflows, so a table or a row still sizes the button to its words.
4
7
  import { tv } from 'tailwind-variants'
5
8
  import type { ActionInput } from './types'
6
9
  import { safeHref } from './safe-url'
7
10
 
8
11
  const button = tv({
9
- base: 'inline-flex items-center justify-center gap-2 rounded-[var(--radius-control,var(--radius-md))] font-medium no-underline transition-colors focus-visible:outline-2 focus-visible:outline-offset-2',
12
+ base: 'inline-flex max-w-full items-center justify-center gap-2 rounded-[var(--radius-control,var(--radius-md))] font-medium no-underline transition-colors focus-visible:outline-2 focus-visible:outline-offset-2',
10
13
  variants: {
11
14
  style: {
12
15
  primary: 'bg-accent text-accent-ink hover:bg-ink hover:text-surface',
@@ -35,4 +38,4 @@ const { action, size, class: className } = Astro.props
35
38
  target={action.newTab ? '_blank' : undefined}
36
39
  rel={action.newTab ? 'noopener' : undefined}
37
40
  class={button({ style: action.style ?? 'primary', size, class: className })}
38
- >{action.label}</a>
41
+ ><span class="min-w-0 text-center [overflow-wrap:break-word]">{action.label}</span></a>
@@ -9,5 +9,6 @@
9
9
  { "name": "eyebrow-note-lg", "props": { "eyebrow": "Free trial", "heading": "Start building today", "body": "Ship a first page in an afternoon.", "note": "No credit card required", "actions": [{ "label": "Subscribe", "href": "/subscribe/" }], "size": "lg", "tone": "muted", "align": "center" } },
10
10
  { "name": "media-end", "props": { "heading": "See it in action", "body": "A short tour of the editor.", "actions": [{ "label": "Subscribe", "href": "/subscribe/" }], "image": { "src": "/kit-fixtures/photo-1.svg", "alt": "The editor", "width": 640, "height": 480 }, "tone": "default", "frame": "card" } },
11
11
  { "name": "media-start-centered", "props": { "heading": "Join the newsletter", "body": "One email a month.", "actions": [{ "label": "Subscribe", "href": "/subscribe/" }], "image": { "src": "/kit-fixtures/photo-2.svg", "alt": "", "width": 640, "height": 480 }, "mediaSide": "start", "layout": "centered", "tone": "inverse" } },
12
- { "name": "background-image", "props": { "heading": "Planning a trip?", "body": "Start with the guides readers use most.", "actions": [{ "label": "Subscribe", "href": "/subscribe/" }], "layout": "centered", "bgImage": "/kit-fixtures/photo-3.svg", "tone": "inverse", "size": "lg" } }
12
+ { "name": "background-image", "props": { "heading": "Planning a trip?", "body": "Start with the guides readers use most.", "actions": [{ "label": "Subscribe", "href": "/subscribe/" }], "layout": "centered", "bgImage": "/kit-fixtures/photo-3.svg", "tone": "inverse", "size": "lg" } },
13
+ { "name": "long-label", "props": { "heading": "Download the full report", "body": "The link as the site printed it.", "actions": [{ "label": "https://example.com/downloads/annual-report-2026-complete-edition.pdf", "href": "/downloads/annual-report/" }] } }
13
14
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentrain/astro-kit",
3
- "version": "0.45.7",
3
+ "version": "0.45.8",
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",