@luhtech/site-template 0.3.2 → 0.3.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luhtech/site-template",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "description": "Shared Astro component library + content-instance contract for LuhTech venture marketing sites -- one template renders every site from content/page.schema.json + content/site.schema.json instances.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -36,11 +36,18 @@ const ICONS: Record<string, string> = {
36
36
  };
37
37
 
38
38
  export interface Props {
39
- name: keyof typeof ICONS;
39
+ /**
40
+ * A real ICONS key. Typed as string (not keyof typeof ICONS) because
41
+ * callers building a name from content data (block.label -> icon,
42
+ * see Section.astro's SectionIcons) can't statically narrow to the
43
+ * literal union -- an unknown name renders nothing rather than
44
+ * failing the build.
45
+ */
46
+ name: string;
40
47
  class?: string;
41
48
  }
42
49
  const { name, class: className = 'w-6 h-6' } = Astro.props;
43
- const inner = ICONS[name] ?? '';
50
+ const inner = ICONS[name as keyof typeof ICONS] ?? '';
44
51
  ---
45
52
  <svg
46
53
  xmlns="http://www.w3.org/2000/svg"
@@ -31,12 +31,28 @@ const SECTION_COMPONENTS: Record<string, any> = {
31
31
  legal: Legal,
32
32
  };
33
33
 
34
+ // icons is an optional, generic per-page mapping a consumer passes to opt a
35
+ // page into the shared line-icon set (Icon.astro) without page.schema.json
36
+ // growing an icon field -- the schema has no such field, and content
37
+ // instances can't carry one, so the mapping lives in the .astro caller
38
+ // (real venture vocabulary: block.label / sectionId -> a real ICONS key)
39
+ // and flows through here to whichever sections/*.astro component knows how
40
+ // to use it. Absent for a section kind that doesn't look at it -- a no-op,
41
+ // not an error.
42
+ export interface SectionIcons {
43
+ /** sectionId -> icon name, for a section-level heading icon. */
44
+ section?: Record<string, string>;
45
+ /** block.label -> icon name, for a per-block icon (e.g. Audiences cards). */
46
+ block?: Record<string, string>;
47
+ }
48
+
34
49
  export interface Props {
35
50
  section: any;
36
51
  site?: any;
37
52
  companyLabel?: string;
53
+ icons?: SectionIcons;
38
54
  }
39
- const { section, site, companyLabel } = Astro.props;
55
+ const { section, site, companyLabel, icons } = Astro.props;
40
56
  const Component = SECTION_COMPONENTS[section.sectionKind];
41
57
  if (!Component) {
42
58
  throw new Error(`Section.astro: unknown sectionKind "${section.sectionKind}" (id: ${section.sectionId})`);
@@ -45,7 +61,7 @@ if (!Component) {
45
61
  {section.sectionKind === 'cta' ? (
46
62
  <Cta section={section} leadCapture={site?.leadCapture} companyLabel={companyLabel} />
47
63
  ) : (
48
- <Component section={section} />
64
+ <Component section={section} icons={icons} />
49
65
  )}
50
66
  {
51
67
  // crossLinks[] is schema-legal on any section kind (not sectionKind-
@@ -18,6 +18,13 @@
18
18
  // don't collide), the nav-logo target selector, and the optional
19
19
  // drifting background data-text lines.
20
20
  //
21
+ // -mt-16 cancels SiteLayout's <main> py-16 top padding -- found live as a
22
+ // visible white bar between the nav and the hero photo (screenshot report,
23
+ // 2026-09-08): the section's own w-screen/-translate-x-1/2 breakout only
24
+ // undoes <main>'s horizontal padding, not the vertical padding above it.
25
+ // LuhTech-Business's own hand-built (pre-template) hero already carried
26
+ // this exact -mt-16, just never generalized into this component before.
27
+ //
21
28
  // heading/lede are meant to carry the SAME brand.identity.tagline/
22
29
  // oneLiner values applyBrandDefaults() binds onto a standard Hero
23
30
  // section on "/" -- this component is a presentation alternative to
@@ -61,7 +68,7 @@ const {
61
68
 
62
69
  const rowPositions = [4, 24, 40, 62, 80, 96];
63
70
  ---
64
- <section class="relative w-screen left-1/2 -translate-x-1/2 h-[85vh] min-h-[520px] overflow-hidden hero-motion" id="hero">
71
+ <section class="relative w-screen left-1/2 -translate-x-1/2 -mt-16 h-[85vh] min-h-[520px] overflow-hidden hero-motion" id="hero">
65
72
  <img src={photoSrc} alt={photoAlt} width="1376" height="768" class="absolute inset-0 w-full h-full object-cover" />
66
73
  <div class="absolute inset-0 hero-gradient"></div>
67
74
  {dataLines.length > 0 && (
@@ -1,10 +1,15 @@
1
1
  ---
2
- // sectionKind: audiences -- one block per buyer role.
2
+ // sectionKind: audiences -- one block per buyer role. icons.block (keyed by
3
+ // block.label, see Section.astro's SectionIcons) is optional -- a consumer
4
+ // with a real per-role icon set opts in; without it every card renders
5
+ // exactly as before.
3
6
  import Block from '../Block.astro';
4
7
  import CtaLink from '../CtaLink.astro';
8
+ import Icon from '../Icon.astro';
9
+ import type { SectionIcons } from '../Section.astro';
5
10
 
6
- export interface Props { section: any }
7
- const { section } = Astro.props;
11
+ export interface Props { section: any; icons?: SectionIcons }
12
+ const { section, icons } = Astro.props;
8
13
  ---
9
14
  <section id={section.sectionId} class="py-8" data-reveal>
10
15
  {section.eyebrow && <p class="text-sm font-mono uppercase tracking-wide text-accent-primary mb-3">{section.eyebrow}</p>}
@@ -12,6 +17,9 @@ const { section } = Astro.props;
12
17
  <div class="grid gap-4 sm:grid-cols-2">
13
18
  {section.blocks?.map((b: any) => (
14
19
  <div class="rounded-md border border-ink/15 p-4">
20
+ {icons?.block?.[b.label] && (
21
+ <Icon name={icons.block[b.label]} class="w-7 h-7 text-accent-primary mb-2" />
22
+ )}
15
23
  <Block block={b} />
16
24
  </div>
17
25
  ))}
@@ -3,12 +3,16 @@
3
3
  // (the schema-legal way a section names a sibling brand) render once,
4
4
  // generically, for every sectionKind -- see Section.astro.
5
5
  import Block from '../Block.astro';
6
+ import Icon from '../Icon.astro';
7
+ import type { SectionIcons } from '../Section.astro';
6
8
 
7
- export interface Props { section: any }
8
- const { section } = Astro.props;
9
+ export interface Props { section: any; icons?: SectionIcons }
10
+ const { section, icons } = Astro.props;
11
+ const sectionIcon = icons?.section?.[section.sectionId];
9
12
  ---
10
13
  <section id={section.sectionId} class="py-8" data-reveal>
11
14
  {section.eyebrow && <p class="text-sm font-mono uppercase tracking-wide text-accent-primary mb-3">{section.eyebrow}</p>}
15
+ {sectionIcon && <Icon name={sectionIcon} class="w-8 h-8 text-accent-primary mb-3" />}
12
16
  {section.heading && <h2 class="font-display text-2xl font-bold mb-3">{section.heading}</h2>}
13
17
  {section.subheading && <p class="text-ink/80 max-w-2xl mb-4">{section.subheading}</p>}
14
18
  {section.blocks?.map((b: any) => <Block block={b} class="mb-3" />)}