@contentrain/astro-kit 0.21.0 → 0.21.1

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/catalog.json CHANGED
@@ -276,7 +276,7 @@
276
276
  "max": 3,
277
277
  "default": 2,
278
278
  "content": false,
279
- "description": "Level of the section heading; card titles are one below."
279
+ "description": "Level of the section heading; card titles are one below, or at this level when there is no title."
280
280
  }
281
281
  },
282
282
  "slots": {},
@@ -1098,7 +1098,7 @@
1098
1098
  "divi/et_pb_blurb"
1099
1099
  ]
1100
1100
  },
1101
- "a11y": "A list; icons are decorative (aria-hidden), the title and text carry the meaning. The section is labelled by its heading.",
1101
+ "a11y": "A list; icons are decorative (aria-hidden), the title and text carry the meaning. Each title is an <h3> under the section's <h2>, or an <h2> when the section has no heading (the list style's are plain text). The section is labelled by its heading.",
1102
1102
  "pattern": {
1103
1103
  "summary": "repeated icon + short title + line of text",
1104
1104
  "signals": [
@@ -2510,7 +2510,7 @@
2510
2510
  "divi/et_pb_pricing_tables"
2511
2511
  ]
2512
2512
  },
2513
- "a11y": "Plans are a <ul>; each name is an <h3>. A featured plan is marked by a text badge and a ring, not colour alone. Buttons are links with their own label.",
2513
+ "a11y": "Plans are a <ul>; each name is an <h3> under the section's <h2>, or an <h2> when the section has no heading. A featured plan is marked by a text badge and a ring, not colour alone. Buttons are links with their own label.",
2514
2514
  "pattern": {
2515
2515
  "summary": "repeated plan units: name + price + feature list + button",
2516
2516
  "signals": [
@@ -3180,7 +3180,7 @@
3180
3180
  "divi/et_pb_blurb"
3181
3181
  ]
3182
3182
  },
3183
- "a11y": "Steps are an <ol>, so their order and count are announced; the visible numbers are CSS counters, not text. Each title is an <h3>. The section is labelled by its heading when it has one.",
3183
+ "a11y": "Steps are an <ol>, so their order and count are announced; the visible numbers are CSS counters, not text. Each title is an <h3> under the section's <h2>, or an <h2> when the section has no heading. The section is labelled by its heading when it has one.",
3184
3184
  "pattern": {
3185
3185
  "summary": "ordered sequence: numbered title + short text units",
3186
3186
  "signals": [
@@ -3291,7 +3291,7 @@
3291
3291
  "classic/tabs"
3292
3292
  ]
3293
3293
  },
3294
- "a11y": "Zag.js tabs: role=tablist/tab/tabpanel with aria-selected, aria-controls and aria-labelledby; arrow keys (per orientation), Home and End move between tabs. Before the script runs every panel is visible with its own h3 title; after, the titles become screen-reader-only and the tabs label the panels.",
3294
+ "a11y": "Zag.js tabs: role=tablist/tab/tabpanel with aria-selected, aria-controls and aria-labelledby; arrow keys (per orientation), Home and End move between tabs. Before the script runs every panel is visible with its own title (an h3 under the section's h2, an h2 when there is no heading); after, the titles become screen-reader-only and the tabs label the panels.",
3295
3295
  "files": [
3296
3296
  "Tabs.astro"
3297
3297
  ]
@@ -3408,7 +3408,7 @@
3408
3408
  "divi/et_pb_team_member"
3409
3409
  ]
3410
3410
  },
3411
- "a11y": "Members are a <ul>; each name is an <h3>, and a linked member's link text is the name. A portrait's text defaults to the name. The section is labelled by its heading when it has one.",
3411
+ "a11y": "Members are a <ul>; each name is an <h3> under the section's <h2> (an <h2> when the section has no heading), and a linked member's link text is the name. A portrait's text defaults to the name. The section is labelled by its heading when it has one.",
3412
3412
  "pattern": {
3413
3413
  "summary": "repeated person units: portrait + name + role",
3414
3414
  "signals": [
@@ -44,7 +44,7 @@ interface Props {
44
44
  title?: string | undefined
45
45
  intro?: string | undefined
46
46
  items: Item[]
47
- /** Heading level of the section title; card titles are one level below. */
47
+ /** Heading level of the section title; card titles are one level below, or at this level when there is no title. */
48
48
  headingLevel?: 2 | 3 | undefined
49
49
  columns?: '2' | '3' | '4' | undefined
50
50
  style?: 'plain' | 'bordered' | 'elevated' | undefined
@@ -57,7 +57,8 @@ const { list, card, media, title: cardTitle, text } = grid({ columns, style, ali
57
57
  // Accent backgrounds have the least contrast headroom: text on them is never dimmed.
58
58
  const dim = tone === 'accent' ? 'opacity-100' : undefined
59
59
  const Heading = `h${headingLevel}` as 'h2' | 'h3'
60
- const CardHeading = `h${headingLevel + 1}` as 'h3' | 'h4'
60
+ // One level under the section title, or the title's level when there is none.
61
+ const CardHeading = `h${title ? headingLevel + 1 : headingLevel}` as 'h2' | 'h3' | 'h4'
61
62
  const headingId = title ? `cards-${title.toLowerCase().replace(/[^a-z0-9]+/g, '-')}` : undefined
62
63
  ---
63
64
  <Section tone={tone} aria-labelledby={headingId}>
@@ -107,7 +107,7 @@
107
107
  "max": 3,
108
108
  "default": 2,
109
109
  "content": false,
110
- "description": "Level of the section heading; card titles are one below."
110
+ "description": "Level of the section heading; card titles are one below, or at this level when there is no title."
111
111
  }
112
112
  },
113
113
  "slots": {},
@@ -64,7 +64,8 @@ const { heading, intro, items, columns, style = 'icon', tone, id } = Astro.props
64
64
  const s = list({ columns, style, tone })
65
65
  const headingId = heading && id ? `${id}-title` : undefined
66
66
  const pathOf = (item: Item) => (style !== 'check' && item.icon && icons[item.icon]) || icons.check
67
- const Title = style === 'list' ? 'span' : 'h3'
67
+ // A plain list's items are not headings; otherwise one level under the section heading, or the section's when there is none.
68
+ const Title = style === 'list' ? 'span' : heading ? 'h3' : 'h2'
68
69
  ---
69
70
  <Section tone={tone} id={id} aria-labelledby={headingId}>
70
71
  {(heading || intro) && (
@@ -106,7 +106,7 @@
106
106
  "divi/et_pb_blurb"
107
107
  ]
108
108
  },
109
- "a11y": "A list; icons are decorative (aria-hidden), the title and text carry the meaning. The section is labelled by its heading.",
109
+ "a11y": "A list; icons are decorative (aria-hidden), the title and text carry the meaning. Each title is an <h3> under the section's <h2>, or an <h2> when the section has no heading (the list style's are plain text). The section is labelled by its heading.",
110
110
  "pattern": {
111
111
  "summary": "repeated icon + short title + line of text",
112
112
  "signals": [
@@ -61,6 +61,8 @@ interface Props {
61
61
  const { heading, intro, plans, featuredLabel = 'Most popular', columns, tone, id } = Astro.props
62
62
  const s = pricing({ columns, tone })
63
63
  const headingId = heading && id ? `${id}-title` : undefined
64
+ // One level under the section heading, or the section's heading when there is none.
65
+ const PlanHeading = heading ? 'h3' : 'h2'
64
66
  const features = await Promise.all(plans.map(plan => renderMarkdown(plan.features)))
65
67
  ---
66
68
  {plans.length > 0 && (
@@ -75,7 +77,7 @@ const features = await Promise.all(plans.map(plan => renderMarkdown(plan.feature
75
77
  {plans.map((plan, i) => (
76
78
  <li class={s.plan({ class: plan.featured ? 'ring-2 ring-accent shadow-lg md:-my-2 md:py-10' : undefined })}>
77
79
  {plan.featured && <p class={s.badge()}>{featuredLabel}</p>}
78
- <h3 class={s.name()}>{plan.name}</h3>
80
+ <PlanHeading class={s.name()}>{plan.name}</PlanHeading>
79
81
  <p class={s.price()}>
80
82
  <span class={s.amount()}>{plan.price}</span>
81
83
  {plan.period && <span class={s.period()}>{plan.period}</span>}
@@ -120,7 +120,7 @@
120
120
  "divi/et_pb_pricing_tables"
121
121
  ]
122
122
  },
123
- "a11y": "Plans are a <ul>; each name is an <h3>. A featured plan is marked by a text badge and a ring, not colour alone. Buttons are links with their own label.",
123
+ "a11y": "Plans are a <ul>; each name is an <h3> under the section's <h2>, or an <h2> when the section has no heading. A featured plan is marked by a text badge and a ring, not colour alone. Buttons are links with their own label.",
124
124
  "pattern": {
125
125
  "summary": "repeated plan units: name + price + feature list + button",
126
126
  "signals": [
@@ -60,6 +60,8 @@ interface Props {
60
60
  const { heading, intro, items, layout, style, id } = Astro.props
61
61
  const s = steps({ layout, style })
62
62
  const headingId = heading && id ? `${id}-title` : undefined
63
+ // One level under the section heading, or the section's heading when there is none.
64
+ const StepHeading = heading ? 'h3' : 'h2'
63
65
  ---
64
66
  {items.length > 0 && (
65
67
  <Section id={id} aria-labelledby={headingId}>
@@ -75,7 +77,7 @@ const headingId = heading && id ? `${id}-title` : undefined
75
77
  {step.number && <span class={s.badge()} aria-hidden="true">{step.number}</span>}
76
78
  <div class={s.body()}>
77
79
  {imageOf(step.image, step.imageAlt) && <div class={s.media()}><KitImage image={imageOf(step.image, step.imageAlt)!} sizes="(min-width: 1024px) 25vw, (min-width: 640px) 50vw, 100vw" class="aspect-[3/2] w-full object-cover" /></div>}
78
- <h3 class={s.title()}>{step.title}</h3>
80
+ <StepHeading class={s.title()}>{step.title}</StepHeading>
79
81
  <p class={s.text()} data-kit-text>{step.text}</p>
80
82
  </div>
81
83
  </li>
@@ -97,7 +97,7 @@
97
97
  "divi/et_pb_blurb"
98
98
  ]
99
99
  },
100
- "a11y": "Steps are an <ol>, so their order and count are announced; the visible numbers are CSS counters, not text. Each title is an <h3>. The section is labelled by its heading when it has one.",
100
+ "a11y": "Steps are an <ol>, so their order and count are announced; the visible numbers are CSS counters, not text. Each title is an <h3> under the section's <h2>, or an <h2> when the section has no heading. The section is labelled by its heading when it has one.",
101
101
  "pattern": {
102
102
  "summary": "ordered sequence: numbered title + short text units",
103
103
  "signals": [
@@ -52,6 +52,8 @@ interface Props {
52
52
  const { items, heading, label, style, orientation = 'horizontal', tone, id = 'tabs' } = Astro.props
53
53
  const s = tabs({ style, orientation, tone })
54
54
  const headingId = heading ? `${id}-title` : undefined
55
+ // One level under the section heading, or the section's heading when there is none.
56
+ const PanelHeading = heading ? 'h3' : 'h2'
55
57
  const value = (i: number) => `tab-${i + 1}`
56
58
  ---
57
59
  {items.length > 0 && (
@@ -63,7 +65,7 @@ const value = (i: number) => `tab-${i + 1}`
63
65
  </div>
64
66
  {items.map((item, i) => (
65
67
  <div data-part="content" data-value={value(i)} class="min-w-0 flex-1">
66
- <h3 class={s.title()}>{item.label}</h3>
68
+ <PanelHeading class={s.title()}>{item.label}</PanelHeading>
67
69
  <div class={s.panel()} set:html={item.content} />
68
70
  </div>
69
71
  ))}
@@ -24,5 +24,5 @@
24
24
  "divi": ["divi/et_pb_tabs"],
25
25
  "classic": ["classic/tabs"]
26
26
  },
27
- "a11y": "Zag.js tabs: role=tablist/tab/tabpanel with aria-selected, aria-controls and aria-labelledby; arrow keys (per orientation), Home and End move between tabs. Before the script runs every panel is visible with its own h3 title; after, the titles become screen-reader-only and the tabs label the panels."
27
+ "a11y": "Zag.js tabs: role=tablist/tab/tabpanel with aria-selected, aria-controls and aria-labelledby; arrow keys (per orientation), Home and End move between tabs. Before the script runs every panel is visible with its own title (an h3 under the section's h2, an h2 when there is no heading); after, the titles become screen-reader-only and the tabs label the panels."
28
28
  }
@@ -57,6 +57,8 @@ interface Props {
57
57
  const { heading, intro, items, columns, style, roleStyle, id } = Astro.props
58
58
  const s = team({ columns, style, roleStyle })
59
59
  const headingId = heading && id ? `${id}-title` : undefined
60
+ // One level under the section heading, or the section's heading when there is none.
61
+ const NameHeading = heading ? 'h3' : 'h2'
60
62
  ---
61
63
  {items.length > 0 && (
62
64
  <Section id={id} aria-labelledby={headingId}>
@@ -71,11 +73,11 @@ const headingId = heading && id ? `${id}-title` : undefined
71
73
  <li class={s.member()}>
72
74
  {/* The portrait's text defaults to the name: a photo of a named person is not decoration. */}
73
75
  {imageOf(member.image, member.imageAlt ?? member.name) && <div class={s.portrait()}><KitImage image={imageOf(member.image, member.imageAlt ?? member.name)!} sizes="(min-width: 1024px) 25vw, (min-width: 640px) 50vw, 100vw" class="aspect-square w-full object-cover" /></div>}
74
- <h3 class={s.name()}>
76
+ <NameHeading class={s.name()}>
75
77
  {member.href
76
78
  ? <a href={member.href} class="text-current no-underline after:absolute after:inset-0 after:content-[''] hover:text-accent">{member.name}</a>
77
79
  : member.name}
78
- </h3>
80
+ </NameHeading>
79
81
  {member.role && <p class={s.role()}>{member.role}</p>}
80
82
  {member.bio && <p class={s.bio()} data-kit-text>{member.bio}</p>}
81
83
  </li>
@@ -110,7 +110,7 @@
110
110
  "divi/et_pb_team_member"
111
111
  ]
112
112
  },
113
- "a11y": "Members are a <ul>; each name is an <h3>, and a linked member's link text is the name. A portrait's text defaults to the name. The section is labelled by its heading when it has one.",
113
+ "a11y": "Members are a <ul>; each name is an <h3> under the section's <h2> (an <h2> when the section has no heading), and a linked member's link text is the name. A portrait's text defaults to the name. The section is labelled by its heading when it has one.",
114
114
  "pattern": {
115
115
  "summary": "repeated person units: portrait + name + role",
116
116
  "signals": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentrain/astro-kit",
3
- "version": "0.21.0",
3
+ "version": "0.21.1",
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.39.0"
45
+ "@contentrain/types": "1.40.0"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/node": "^22.10.0",