@dloizides/marketing-astro-kit 1.11.0 → 1.13.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 (62) hide show
  1. package/CHANGELOG.md +173 -154
  2. package/README.md +72 -26
  3. package/package.json +16 -7
  4. package/src/ContactCard.astro +107 -0
  5. package/src/contactCard/CardActions.astro +20 -0
  6. package/src/contactCard/CardBrand.astro +25 -0
  7. package/src/contactCard/CardContacts.astro +22 -0
  8. package/src/contactCard/CardContactsVariant.ts +5 -0
  9. package/src/contactCard/CardDialog.astro +16 -0
  10. package/src/contactCard/CardIcon.astro +12 -0
  11. package/src/contactCard/CardIconName.ts +6 -0
  12. package/src/contactCard/CardIdentity.astro +14 -0
  13. package/src/contactCard/CardLinkKind.ts +6 -0
  14. package/src/contactCard/CardPortrait.astro +14 -0
  15. package/src/contactCard/CardQr.astro +24 -0
  16. package/src/contactCard/CardSave.astro +43 -0
  17. package/src/contactCard/CardValues.astro +12 -0
  18. package/src/contactCard/ContactCardLayout.ts +7 -0
  19. package/src/contactCard/ContactPhotoType.ts +5 -0
  20. package/src/contactCard/InstallRoute.ts +6 -0
  21. package/src/contactCard/cardIcons.ts +11 -0
  22. package/src/contactCard/cardLinks.ts +43 -0
  23. package/src/contactCard/checks.ts +28 -0
  24. package/src/contactCard/chooseInstall.ts +21 -0
  25. package/src/contactCard/contactCard.css +69 -0
  26. package/src/contactCard/index.ts +16 -0
  27. package/src/contactCard/layouts.css +106 -0
  28. package/src/contactCard/manifest.ts +37 -0
  29. package/src/contactCard/motion/OpenMotion.ts +7 -0
  30. package/src/contactCard/motion/QrMotion.ts +7 -0
  31. package/src/contactCard/motion/SaveMotion.ts +7 -0
  32. package/src/contactCard/motion/TiltMotion.ts +7 -0
  33. package/src/contactCard/motion/beatTable.ts +144 -0
  34. package/src/contactCard/motion/beats.ts +43 -0
  35. package/src/contactCard/motion/cardMotion.ts +49 -0
  36. package/src/contactCard/motion/easings.ts +9 -0
  37. package/src/contactCard/motion/holdDuringOpen.ts +22 -0
  38. package/src/contactCard/motion/mountMotion.ts +26 -0
  39. package/src/contactCard/motion/mountOpenMark.ts +20 -0
  40. package/src/contactCard/motion/mountQrTurn.ts +86 -0
  41. package/src/contactCard/motion/mountSave.ts +26 -0
  42. package/src/contactCard/motion/mountTilt.ts +92 -0
  43. package/src/contactCard/motion/openCss.ts +18 -0
  44. package/src/contactCard/motion/parts.ts +25 -0
  45. package/src/contactCard/motion/playBeats.ts +21 -0
  46. package/src/contactCard/motion/sides.ts +33 -0
  47. package/src/contactCard/motion/tiltPose.ts +38 -0
  48. package/src/contactCard/motion.css +39 -0
  49. package/src/contactCard/mount.ts +76 -0
  50. package/src/contactCard/phone.ts +11 -0
  51. package/src/contactCard/qrSvg.ts +54 -0
  52. package/src/contactCard/types.ts +47 -0
  53. package/src/contactCard/vCard.ts +48 -0
  54. package/src/contactCard/vCardLines.ts +33 -0
  55. package/src/logoIntro/LogoIntroState.ts +8 -0
  56. package/src/logoIntro/geometry.ts +53 -0
  57. package/src/logoIntro/index.ts +6 -0
  58. package/src/logoIntro/runLogoIntro.ts +75 -0
  59. package/src/logoIntro/settleReveal.ts +146 -0
  60. package/src/logoIntro/strokes.ts +61 -0
  61. package/src/logoIntro/timeline.ts +30 -0
  62. package/src/motionController/createMotionController.ts +11 -9
package/CHANGELOG.md CHANGED
@@ -1,154 +1,173 @@
1
- # Changelog
2
-
3
- ## 1.11.0
4
-
5
- ### Added
6
-
7
- - `./scrollFade`: `createScrollFade({ belowLevel, switchShare })` returns the scroll-linked opacity curve of a page-wide background (full over the hero, falling to `belowLevel`) and `isBelow`, true once less than `switchShare` of the hero is on screen; `heroProgress(scrollY, heroHeight)` gives that share (MOONCUBE-SITE-4 "Faded background continues below the hero").
8
-
9
- ## 1.10.0
10
-
11
- ### Added
12
-
13
- - `./motionController`: `createMotionController(options)` runs a frame loop only while the page is visible and the target is in view, and holds a still under `prefers-reduced-motion` (MOONCUBE-SITE-3 "Stunning background, DevOps experience and ISO 27001 controls"). Its source is self-contained, so an `is:inline` script can carry it.
14
-
15
- ### Changed
16
-
17
- - `HeroBackdrop` uses `createMotionController`; behaviour unchanged.
18
-
19
- ## 1.9.1
20
-
21
- ### Fixed
22
-
23
- - `MeetingRequestForm`: every input, select and textarea shows a 2px `:focus-visible` ring, colour `--tmk-mr-focus` (default `currentColor`; also feeds the day field's `--tmk-df-focus`). MOONCUBE-SITE-1 "Moon Cube Technologies site: read and book", D-SITE-36.
24
-
25
- ## 1.9.0
26
-
27
- ### Added
28
-
29
- - `<MeetingRequestForm />` (`./MeetingRequestForm.astro`) + `./meetingRequest` helpers: preferred day, time of day, name, email, company, message; validation (past day, bad email), JSON POST with timeout, sent / rate-limited (429) / failed states, mailto assembled in the browser, honeypot `website`, Send loading state, optional Umami event. Labels and endpoint are options; no subject is sent. MOONCUBE-SITE-1 "Moon Cube Technologies site: read and book", AC-07, AC-08, AC-18, AC-20, AC-21, AC-22.
30
- - `<DateField />` (`./DateField.astro`) + `./dateField` helpers: the shared date input for Astro sites (DATE-INPUT-1 "Every date or date-time field uses the shared input"): native picker, label, min/max, error with `aria-invalid` + `aria-describedby`, 44 px control, themed by `--tmk-df-*`. `MeetingRequestForm` uses it for the day. MOONCUBE-SITE-1, D-SITE-17.
31
-
32
- ### Changed
33
-
34
- - `MeetingRequestForm`: the message is required, at least 10 characters (matches the `/contact` server validator); new error kind `too-short` in `labels.errors`.
35
-
36
- ## 1.8.0
37
-
38
- ### Added
39
-
40
- - `<BookingEmbed />` (`./BookingEmbed.astro`) + `./bookingEmbed` helpers: Cal.com inline embed set by options, contact fallback after 8 s or a load error, address assembled in the browser. Unit tests (vitest), lint and typecheck scripts. MOONCUBE-SITE-1 "Moon Cube Technologies site: read and book", AC-18.
41
-
42
- ## 1.7.0
43
-
44
- ### Added
45
-
46
- - `<BottomSheet />` (`./BottomSheet.astro`): slot-based phone bottom sheet opened by `:target`, inline at 1024 px and up. Sits above `--dlz-consent-inset`. BEAD-ONE-2 "One-host follow-ups".
47
-
48
- ## 1.6.1
49
-
50
- ### Fixed
51
-
52
- - `HairlineFigure` mount: a failed lazy-chunk load or figure mount no longer becomes an unhandled rejection. The host gets `data-hairline-failed="true"` and the page logs one `console.warn`. HAIRLINE-1 "Adopt hairline isometric line figures".
53
- - README: a sub-path host (kefi-landings) needs `build.assetsPrefix` set to an ABSOLUTE origin serving `dist/_astro/`; a relative prefix fails silently.
54
-
55
- ## 1.6.0
56
-
57
- ### Added
58
-
59
- - `<HairlineFigure />` (`./HairlineFigure.astro`) plus `HAIRLINE_FIGURES`, `TOUCH_SAFE_HAIRLINE_FIGURES` and `clampHairlineIntensity` (`./hairline`). Wraps `@lucasmarkes/hairline` 0.3.0 (exact pin): SSR 5:4 box, lazy mount near the viewport, destroy on page swap, `--hairline-*` mapped from the theming contract. HAIRLINE-1 "Adopt hairline isometric line figures".
60
-
61
- ## 1.5.2
62
-
63
- ### Fixed
64
-
65
- - `.dmk-disclaimer` (DemoFrame) and `.pmk-footnote` (PricingComparison) cap their measure at 65ch; at 1280 px they ran 102-113 characters per line. Mobile is unaffected.
66
-
67
- ## 1.3.0
68
-
69
- ### Added
70
-
71
- - `<HeroBackdrop />` plus the named hero-backdrop preset catalog (`./heroBackdrop`).
72
- Nine animated hero treatments -- three canvas, one SVG-filter, five pure-CSS --
73
- that until now existed ONLY in a disposable per-session scratchpad and had been
74
- rebuilt from scratch more than once. `HERO_BACKDROP_PRESETS` is the permanent
75
- record: preset name -> `{ variant, engine, palette, css, ember }`, using the
76
- design studio's own parameter names verbatim so a studio export pastes in with
77
- no translation step.
78
- - `csdf-ember-sparse` -- CSDF's shipped configuration. 40 particles, an eighth of
79
- the studio default, which is what makes a canvas backdrop affordable against a
80
- hard Lighthouse >= 80 budget.
81
- - Only the ember canvas engine ships as a RENDERER. The CSS/SVG entries are
82
- recorded PARAMETER SETS painted by the host stylesheet; the component renders
83
- nothing for those, leaving the host's own backdrop untouched.
84
-
85
- ### Notes
86
-
87
- - The component's script is `is:inline` deliberately -- a bundled Astro script
88
- emits a root-absolute `/_astro/*.js` reference, which 404s under kefi-landings'
89
- host-based per-tenant nginx roots.
90
- - Respects `prefers-reduced-motion` (one still frame, no loop) and stops the rAF
91
- loop on `visibilitychange` and when the canvas leaves the viewport.
92
-
93
- ## 1.2.1
94
-
95
- - **a11y fix (serious): the pricing comparison was SILENT to screen readers.**
96
- `PricingComparison.astro` marked each cell with `aria-label` on a bare
97
- `<span>`. `aria-label` is *prohibited* on a roleless generic element, so
98
- assistive tech ignored it — and the inner `<svg>` is `aria-hidden`. Net
99
- effect: a screen-reader user reached every included/not-included cell and
100
- heard **nothing**, so they could not tell which plan carried which feature,
101
- on a public pricing page. Fixed by giving the span `role="img"` alongside
102
- the existing label. Found by the `a11y-public` E2E axe scan against the live
103
- kefi landing: `aria-prohibited-attr`, 27 nodes. Swept the rest of the kit —
104
- no other instances of this shape.
105
-
106
- ## 1.2.0
107
-
108
- - New `DemoFrame.astro` — a themeable, **client-side "try it" demo** shell for
109
- static marketing sites (no backend): an eyebrow/title/intro, a row of clickable
110
- example chips, a per-example result panel (bespoke product body injected via a
111
- named slot `result-<example.id>`), a clearly-visible "sample data" disclaimer,
112
- and a primary CTA (reuses `PrimaryCta`). Tiny inline vanilla JS toggles which
113
- result shows on chip click (+ arrow-key roving tablist); the first example is
114
- visible without JS (progressive enhancement). New `DemoExample` / `DemoFrameData`
115
- types in `schema.ts`.
116
- - New `GuideCard.astro` — a themeable card for a **guides / SEO content-hub**
117
- listing, rendering one guide's tags, title, description and date. New
118
- `GuideCardData` type.
119
- - New `guideFrontmatterSchema` (Zod, built on `astro/zod`) + `GuideFrontmatter`
120
- type in `schema.ts` — plug straight into an Astro content collection
121
- (`defineCollection({ loader: glob(...), schema: guideFrontmatterSchema })`) so
122
- every product's guides validate the same shape (title, description, slug?,
123
- publishDate, updatedDate?, tags, ogImage?, canonical?, draft?). The article
124
- page + routes + JSON-LD stay product-owned.
125
- - `schema.ts` now imports `z` from `astro/zod` (Astro is already a peer dep) —
126
- the ONE runtime import; every other export stays plain types.
127
-
128
- ## 1.1.0
129
-
130
- - New `PrimaryCta.astro` — a themeable primary call-to-action (link OR spam-safe
131
- contact) with an optional secondary CTA and a `tone: 'light' | 'dark'` for
132
- dark bands. Renders a `MarketingCta` so link-vs-lead-capture + analytics wiring
133
- is no longer hand-coded per page.
134
- - New `buildPrimaryCta(opts)` helper + `PrimaryCtaOptions` in `schema.ts`: drive
135
- a primary CTA from ONE `SIGNUP_URL` constant — a real signup link when set,
136
- spam-safe lead-capture when `null` (flip at GA with no template change).
137
- - `ctaAttrs()` promoted from `PricingComparison.astro` into `schema.ts` and now
138
- shared by every CTA-rendering component (no duplication).
139
- - `TrustSection` gains three optional, guarded fields (existing sites
140
- unaffected): `foundingPartner` ("first N free during beta" panel),
141
- `founder` (honest one-line credibility) and `sampleDeliverable` (a "here's the
142
- actual report you get" showcase — image, or a `slot="sample-deliverable"` for
143
- bespoke mock markup while the section chrome stays shared).
144
-
145
- ## 1.0.0
146
-
147
- - Initial release. `PricingComparison.astro` (Free-vs-Pro comparison table with
148
- tier columns, grouped feature rows, optional footnote + one-time callout card)
149
- and `TrustSection.astro` (security cards with inline icons, customer-logo row
150
- with placeholders, testimonial placeholders, discreet built-by line).
151
- - Framework-agnostic data schema (`schema.ts`) + inline icon set (`icons.ts`).
152
- - Themed via host CSS custom properties with fallbacks; no image assets.
153
- - Extracted from `kefi-marketing` as the 2nd genuine use of the pricing/trust
154
- sections across the Astro marketing sites.
1
+ # Changelog
2
+
3
+ ## 1.13.0
4
+
5
+ ### Added
6
+
7
+ - `./contactCard`: the logic of a digital business card. `buildVCard(options)` returns a vCard 3.0 file (escaped, folded at 75 octets, CRLF, optional JPEG or PNG photo), `buildContactCardManifest(options)` a web manifest that installs one person's card as its own app, `buildQrSvg(options)` a QR code as standalone SVG, `toDialNumber(phone)` the number for a `tel:` link. A bad option throws, so it fails the build.
8
+ - `./ContactCard.astro`: the card itself, in four layouts (`portrait`, `name`, `framed`, `honeycomb`), with Save contact, call, email and website links, a QR dialog and Add to home screen.
9
+ - Dependencies `@dloizides/pwa-sw` (manifest builder) and `qrcode-generator`.
10
+ - `ContactCard.astro` motion: a `motion` prop with four settings (`openMotion`, `tiltMotion`, `qrMotion`, `saveMotion`), each with `none` and three options, recommended ones by default, stills under reduced motion. The settings are written to `data-open-motion`, `data-tilt-motion`, `data-qr-motion` and `data-save-motion`; `data-tilting` marks a lean.
11
+ - `ContactCard.astro` `brandMarkup` prop: a `@dloizides/logo-kit` mark drawn in on open.
12
+ - `ContactCardLabels` gains the required `hideQr` and `ready`.
13
+ - `--tmk-card-name-line-height` (default 1.2) and `--tmk-card-role-line-height` (default 1.3).
14
+ - `createMotionController` takes an optional `signal`; aborting it stops the frame loop and removes its listeners and observer. Without a signal it behaves as before.
15
+
16
+ ## 1.12.0
17
+
18
+ ### Added
19
+
20
+ - `./logoIntro`: `runLogoIntro(options)` plays a site mark big and centred, glides it into its hero slot at its resting opacity, then runs a reveal; still under `prefers-reduced-motion`; writes `data-logo-intro` (pending, playing, done, still) on the state host; a width change mid-run finishes it. Helpers `drawStrokes`, `sweepStrokes` (logo phase) and `settleReveal` (accent rules and outlines draw, copy settles, overlays fade). FINREG-INTRO-1 "finreginfotech.com opens with a Moon Cube style logo intro".
21
+
22
+ ## 1.11.0
23
+
24
+ ### Added
25
+
26
+ - `./scrollFade`: `createScrollFade({ belowLevel, switchShare })` returns the scroll-linked opacity curve of a page-wide background (full over the hero, falling to `belowLevel`) and `isBelow`, true once less than `switchShare` of the hero is on screen; `heroProgress(scrollY, heroHeight)` gives that share (MOONCUBE-SITE-4 "Faded background continues below the hero").
27
+
28
+ ## 1.10.0
29
+
30
+ ### Added
31
+
32
+ - `./motionController`: `createMotionController(options)` runs a frame loop only while the page is visible and the target is in view, and holds a still under `prefers-reduced-motion` (MOONCUBE-SITE-3 "Stunning background, DevOps experience and ISO 27001 controls"). Its source is self-contained, so an `is:inline` script can carry it.
33
+
34
+ ### Changed
35
+
36
+ - `HeroBackdrop` uses `createMotionController`; behaviour unchanged.
37
+
38
+ ## 1.9.1
39
+
40
+ ### Fixed
41
+
42
+ - `MeetingRequestForm`: every input, select and textarea shows a 2px `:focus-visible` ring, colour `--tmk-mr-focus` (default `currentColor`; also feeds the day field's `--tmk-df-focus`). MOONCUBE-SITE-1 "Moon Cube Technologies site: read and book", D-SITE-36.
43
+
44
+ ## 1.9.0
45
+
46
+ ### Added
47
+
48
+ - `<MeetingRequestForm />` (`./MeetingRequestForm.astro`) + `./meetingRequest` helpers: preferred day, time of day, name, email, company, message; validation (past day, bad email), JSON POST with timeout, sent / rate-limited (429) / failed states, mailto assembled in the browser, honeypot `website`, Send loading state, optional Umami event. Labels and endpoint are options; no subject is sent. MOONCUBE-SITE-1 "Moon Cube Technologies site: read and book", AC-07, AC-08, AC-18, AC-20, AC-21, AC-22.
49
+ - `<DateField />` (`./DateField.astro`) + `./dateField` helpers: the shared date input for Astro sites (DATE-INPUT-1 "Every date or date-time field uses the shared input"): native picker, label, min/max, error with `aria-invalid` + `aria-describedby`, 44 px control, themed by `--tmk-df-*`. `MeetingRequestForm` uses it for the day. MOONCUBE-SITE-1, D-SITE-17.
50
+
51
+ ### Changed
52
+
53
+ - `MeetingRequestForm`: the message is required, at least 10 characters (matches the `/contact` server validator); new error kind `too-short` in `labels.errors`.
54
+
55
+ ## 1.8.0
56
+
57
+ ### Added
58
+
59
+ - `<BookingEmbed />` (`./BookingEmbed.astro`) + `./bookingEmbed` helpers: Cal.com inline embed set by options, contact fallback after 8 s or a load error, address assembled in the browser. Unit tests (vitest), lint and typecheck scripts. MOONCUBE-SITE-1 "Moon Cube Technologies site: read and book", AC-18.
60
+
61
+ ## 1.7.0
62
+
63
+ ### Added
64
+
65
+ - `<BottomSheet />` (`./BottomSheet.astro`): slot-based phone bottom sheet opened by `:target`, inline at 1024 px and up. Sits above `--dlz-consent-inset`. BEAD-ONE-2 "One-host follow-ups".
66
+
67
+ ## 1.6.1
68
+
69
+ ### Fixed
70
+
71
+ - `HairlineFigure` mount: a failed lazy-chunk load or figure mount no longer becomes an unhandled rejection. The host gets `data-hairline-failed="true"` and the page logs one `console.warn`. HAIRLINE-1 "Adopt hairline isometric line figures".
72
+ - README: a sub-path host (kefi-landings) needs `build.assetsPrefix` set to an ABSOLUTE origin serving `dist/_astro/`; a relative prefix fails silently.
73
+
74
+ ## 1.6.0
75
+
76
+ ### Added
77
+
78
+ - `<HairlineFigure />` (`./HairlineFigure.astro`) plus `HAIRLINE_FIGURES`, `TOUCH_SAFE_HAIRLINE_FIGURES` and `clampHairlineIntensity` (`./hairline`). Wraps `@lucasmarkes/hairline` 0.3.0 (exact pin): SSR 5:4 box, lazy mount near the viewport, destroy on page swap, `--hairline-*` mapped from the theming contract. HAIRLINE-1 "Adopt hairline isometric line figures".
79
+
80
+ ## 1.5.2
81
+
82
+ ### Fixed
83
+
84
+ - `.dmk-disclaimer` (DemoFrame) and `.pmk-footnote` (PricingComparison) cap their measure at 65ch; at 1280 px they ran 102-113 characters per line. Mobile is unaffected.
85
+
86
+ ## 1.3.0
87
+
88
+ ### Added
89
+
90
+ - `<HeroBackdrop />` plus the named hero-backdrop preset catalog (`./heroBackdrop`).
91
+ Nine animated hero treatments -- three canvas, one SVG-filter, five pure-CSS --
92
+ that until now existed ONLY in a disposable per-session scratchpad and had been
93
+ rebuilt from scratch more than once. `HERO_BACKDROP_PRESETS` is the permanent
94
+ record: preset name -> `{ variant, engine, palette, css, ember }`, using the
95
+ design studio's own parameter names verbatim so a studio export pastes in with
96
+ no translation step.
97
+ - `csdf-ember-sparse` -- CSDF's shipped configuration. 40 particles, an eighth of
98
+ the studio default, which is what makes a canvas backdrop affordable against a
99
+ hard Lighthouse >= 80 budget.
100
+ - Only the ember canvas engine ships as a RENDERER. The CSS/SVG entries are
101
+ recorded PARAMETER SETS painted by the host stylesheet; the component renders
102
+ nothing for those, leaving the host's own backdrop untouched.
103
+
104
+ ### Notes
105
+
106
+ - The component's script is `is:inline` deliberately -- a bundled Astro script
107
+ emits a root-absolute `/_astro/*.js` reference, which 404s under kefi-landings'
108
+ host-based per-tenant nginx roots.
109
+ - Respects `prefers-reduced-motion` (one still frame, no loop) and stops the rAF
110
+ loop on `visibilitychange` and when the canvas leaves the viewport.
111
+
112
+ ## 1.2.1
113
+
114
+ - **a11y fix (serious): the pricing comparison was SILENT to screen readers.**
115
+ `PricingComparison.astro` marked each cell with `aria-label` on a bare
116
+ `<span>`. `aria-label` is *prohibited* on a roleless generic element, so
117
+ assistive tech ignored it — and the inner `<svg>` is `aria-hidden`. Net
118
+ effect: a screen-reader user reached every included/not-included cell and
119
+ heard **nothing**, so they could not tell which plan carried which feature,
120
+ on a public pricing page. Fixed by giving the span `role="img"` alongside
121
+ the existing label. Found by the `a11y-public` E2E axe scan against the live
122
+ kefi landing: `aria-prohibited-attr`, 27 nodes. Swept the rest of the kit —
123
+ no other instances of this shape.
124
+
125
+ ## 1.2.0
126
+
127
+ - New `DemoFrame.astro` — a themeable, **client-side "try it" demo** shell for
128
+ static marketing sites (no backend): an eyebrow/title/intro, a row of clickable
129
+ example chips, a per-example result panel (bespoke product body injected via a
130
+ named slot `result-<example.id>`), a clearly-visible "sample data" disclaimer,
131
+ and a primary CTA (reuses `PrimaryCta`). Tiny inline vanilla JS toggles which
132
+ result shows on chip click (+ arrow-key roving tablist); the first example is
133
+ visible without JS (progressive enhancement). New `DemoExample` / `DemoFrameData`
134
+ types in `schema.ts`.
135
+ - New `GuideCard.astro` — a themeable card for a **guides / SEO content-hub**
136
+ listing, rendering one guide's tags, title, description and date. New
137
+ `GuideCardData` type.
138
+ - New `guideFrontmatterSchema` (Zod, built on `astro/zod`) + `GuideFrontmatter`
139
+ type in `schema.ts` — plug straight into an Astro content collection
140
+ (`defineCollection({ loader: glob(...), schema: guideFrontmatterSchema })`) so
141
+ every product's guides validate the same shape (title, description, slug?,
142
+ publishDate, updatedDate?, tags, ogImage?, canonical?, draft?). The article
143
+ page + routes + JSON-LD stay product-owned.
144
+ - `schema.ts` now imports `z` from `astro/zod` (Astro is already a peer dep) —
145
+ the ONE runtime import; every other export stays plain types.
146
+
147
+ ## 1.1.0
148
+
149
+ - New `PrimaryCta.astro` — a themeable primary call-to-action (link OR spam-safe
150
+ contact) with an optional secondary CTA and a `tone: 'light' | 'dark'` for
151
+ dark bands. Renders a `MarketingCta` so link-vs-lead-capture + analytics wiring
152
+ is no longer hand-coded per page.
153
+ - New `buildPrimaryCta(opts)` helper + `PrimaryCtaOptions` in `schema.ts`: drive
154
+ a primary CTA from ONE `SIGNUP_URL` constant — a real signup link when set,
155
+ spam-safe lead-capture when `null` (flip at GA with no template change).
156
+ - `ctaAttrs()` promoted from `PricingComparison.astro` into `schema.ts` and now
157
+ shared by every CTA-rendering component (no duplication).
158
+ - `TrustSection` gains three optional, guarded fields (existing sites
159
+ unaffected): `foundingPartner` ("first N free during beta" panel),
160
+ `founder` (honest one-line credibility) and `sampleDeliverable` (a "here's the
161
+ actual report you get" showcase — image, or a `slot="sample-deliverable"` for
162
+ bespoke mock markup while the section chrome stays shared).
163
+
164
+ ## 1.0.0
165
+
166
+ - Initial release. `PricingComparison.astro` (Free-vs-Pro comparison table with
167
+ tier columns, grouped feature rows, optional footnote + one-time callout card)
168
+ and `TrustSection.astro` (security cards with inline icons, customer-logo row
169
+ with placeholders, testimonial placeholders, discreet built-by line).
170
+ - Framework-agnostic data schema (`schema.ts`) + inline icon set (`icons.ts`).
171
+ - Themed via host CSS custom properties with fallbacks; no image assets.
172
+ - Extracted from `kefi-marketing` as the 2nd genuine use of the pricing/trust
173
+ sections across the Astro marketing sites.
package/README.md CHANGED
@@ -10,7 +10,7 @@ credibility + conversion markers an executive scans for before they trust a SaaS
10
10
  | `PrimaryCta.astro` | A themeable **primary call-to-action** (link OR spam-safe contact) with an optional secondary CTA. Pair with `buildPrimaryCta` so ONE `SIGNUP_URL` constant drives whether it's a real signup link or lead-capture. |
11
11
  | `DemoFrame.astro` | A themeable, **client-side "try it" demo** shell for static sites (no backend): eyebrow/title/intro, a row of clickable example chips, a per-example result panel (bespoke product body via a named `result-<id>` slot), a "sample data" disclaimer, and a primary CTA. Tiny inline vanilla JS toggles which result shows; first example visible without JS. |
12
12
  | `GuideCard.astro` | A themeable **card for a guides / SEO content-hub** listing — one guide's tags, title, description and date. Pair with `guideFrontmatterSchema` on an Astro content collection. |
13
- | `BookingEmbed.astro` | A **Cal.com inline booking embed** set by options (link, theme, brand colours), loaded on its page only, with a spam-safe contact fallback after a timeout or load error. |
13
+ | `BookingEmbed.astro` | A **Cal.com inline booking embed** set by options (link, theme, brand colours), loaded on its page only, with a spam-safe contact fallback after a timeout or load error. |
14
14
  | `HairlineFigure.astro` | A **Hairline isometric line figure** (`@lucasmarkes/hairline`, pinned 0.3.0) for heroes and empty states: an empty 5:4 box server-side, drawn on the client once it nears the viewport, coloured from the host's tokens. |
15
15
 
16
16
  ## Config-driven primary CTA (`PrimaryCta` + `buildPrimaryCta`)
@@ -186,29 +186,29 @@ import HairlineFigure from '@dloizides/marketing-astro-kit/HairlineFigure.astro'
186
186
  - **Script bundling:** unlike `HeroBackdrop`, this script is a bundled Astro `<script>` (it imports an npm module), so it emits a root-absolute `/_astro/*.js` URL. On a host that serves a tenant from a sub-directory (kefi-landings: the nginx root is the tenant sub-directory), set Astro's `build.assetsPrefix` to an ABSOLUTE origin (`https://cdn.example.com`) that serves this build's `dist/_astro/`, both the entry script and the lazy Hairline chunk. A relative prefix fails silently: the chunk 404s and the box stays empty, marked `data-hairline-failed` with one `console.warn`.
187
187
  - **Vite-alias consumers** (the kit aliased to source, not installed) must have `@lucasmarkes/hairline@0.3.0` resolvable from the site.
188
188
 
189
- ## Booking embed (`BookingEmbed`)
190
-
191
- ```astro
192
- ---
193
- import BookingEmbed from "@dloizides/marketing-astro-kit/BookingEmbed.astro";
194
- import { BookingTheme, CalLayout } from "@dloizides/marketing-astro-kit/bookingEmbed";
195
- ---
196
- <BookingEmbed
197
- id="book"
198
- label="Book a call"
199
- options={{ calLink: "mooncube/intro", theme: BookingTheme.Dark, layout: CalLayout.Month,
200
- hideEventTypeDetails: true, cssVarsPerTheme: { dark: { "cal-bg": "#0F1B2D", "cal-brand": "#E8C36A" } } }}
201
- contact={{ local: "hello", domain: "example.com" }}
202
- >
203
- <p slot="fallback">Calendar unavailable. Email <a data-booking-contact></a></p>
204
- </BookingEmbed>
205
- ```
206
-
207
- - Options: `calLink` (required, Cal.com path), `theme` (default dark), `layout` (default month view), `hideEventTypeDetails`, `cssVarsPerTheme` (`cal-*` names, hex only, checked at build), `timeoutMs` (default 8000), `namespace` (`^[\w-]+$`, default the host `id`), `origin` (https URL with no path, default `https://app.cal.com`; the embed script loads from `<origin>/embed/embed.js`).
208
- - The Cal.com script is added by the component script only when a host is on the page.
209
- - The fallback slot shows after `timeoutMs` with no `linkReady`, on `linkFailed`, or when the script fails, for hosts mounted by any later call too. Each `[data-booking-contact]` link gets its `mailto:` filled in the browser from `data-local` + `data-domain`; the served HTML holds no address.
210
- - `data-booking-state` on the host is `loading`, `ready` or `fallback`. Set `--tmk-booking-min-height` (default 640px).
211
-
189
+ ## Booking embed (`BookingEmbed`)
190
+
191
+ ```astro
192
+ ---
193
+ import BookingEmbed from "@dloizides/marketing-astro-kit/BookingEmbed.astro";
194
+ import { BookingTheme, CalLayout } from "@dloizides/marketing-astro-kit/bookingEmbed";
195
+ ---
196
+ <BookingEmbed
197
+ id="book"
198
+ label="Book a call"
199
+ options={{ calLink: "mooncube/intro", theme: BookingTheme.Dark, layout: CalLayout.Month,
200
+ hideEventTypeDetails: true, cssVarsPerTheme: { dark: { "cal-bg": "#0F1B2D", "cal-brand": "#E8C36A" } } }}
201
+ contact={{ local: "hello", domain: "example.com" }}
202
+ >
203
+ <p slot="fallback">Calendar unavailable. Email <a data-booking-contact></a></p>
204
+ </BookingEmbed>
205
+ ```
206
+
207
+ - Options: `calLink` (required, Cal.com path), `theme` (default dark), `layout` (default month view), `hideEventTypeDetails`, `cssVarsPerTheme` (`cal-*` names, hex only, checked at build), `timeoutMs` (default 8000), `namespace` (`^[\w-]+$`, default the host `id`), `origin` (https URL with no path, default `https://app.cal.com`; the embed script loads from `<origin>/embed/embed.js`).
208
+ - The Cal.com script is added by the component script only when a host is on the page.
209
+ - The fallback slot shows after `timeoutMs` with no `linkReady`, on `linkFailed`, or when the script fails, for hosts mounted by any later call too. Each `[data-booking-contact]` link gets its `mailto:` filled in the browser from `data-local` + `data-domain`; the served HTML holds no address.
210
+ - `data-booking-state` on the host is `loading`, `ready` or `fallback`. Set `--tmk-booking-min-height` (default 640px).
211
+
212
212
  ## Bottom sheet (`BottomSheet`)
213
213
 
214
214
  Below 1024 px the default slot opens as a bottom sheet when the URL hash equals `id`; link to `#id` to open it. From 1024 px the slot renders inline and the head and foot are hidden. The `foot` slot holds the sticky action. Set `--tmk-sheet-bg` and `--tmk-sheet-edge` to theme it (fallbacks `--paper`, `--ink`). It stays above a consent card through `--dlz-consent-inset`. The close link carries `data-sheet-close`.
@@ -302,5 +302,51 @@ The Astro build (Rollup) only needs the Vite alias — types are not required fo
302
302
  ## Motion controller
303
303
 
304
304
  `@dloizides/marketing-astro-kit/motionController` exports `createMotionController(options): { getState, sync }`. It runs `onFrame(deltaMs)` only while the page is visible and `target` is in view, and calls `onStill()` under `prefers-reduced-motion`. `forceStill` and `canRun` add host conditions; call `sync()` when they change. `watchReducedMotion: false` reads the preference once. The function references no module scope, so `HeroBackdrop` carries its source in an `is:inline` script.
305
-
306
- `@dloizides/marketing-astro-kit/scrollFade` exports `createScrollFade({ belowLevel, switchShare }): { opacity, isBelow }` and `heroProgress(scrollY, heroHeight)`. `heroProgress` is 1 at the top of the page and 0 once the hero has scrolled away; `opacity(progress)` runs from 1 down to `belowLevel`; `isBelow(progress)` is true once less than `switchShare` of the hero is on screen.
305
+
306
+ `@dloizides/marketing-astro-kit/scrollFade` exports `createScrollFade({ belowLevel, switchShare }): { opacity, isBelow }` and `heroProgress(scrollY, heroHeight)`. `heroProgress` is 1 at the top of the page and 0 once the hero has scrolled away; `opacity(progress)` runs from 1 down to `belowLevel`; `isBelow(progress)` is true once less than `switchShare` of the hero is on screen.
307
+
308
+ ## Contact card
309
+
310
+ `@dloizides/marketing-astro-kit/contactCard` builds the files behind a digital business card. Call it at build time, from a static endpoint or page frontmatter.
311
+
312
+ ```ts
313
+ import { buildContactCardManifest, buildQrSvg, buildVCard } from '@dloizides/marketing-astro-kit/contactCard';
314
+
315
+ const vcf = buildVCard({ givenName, familyName, organisation, role, phone, email, website });
316
+ const manifest = buildContactCardManifest({ cardPath: '/card/sam/', name, shortName, description, themeColor, backgroundColor, icons });
317
+ const qr = buildQrSvg({ url: 'https://example.test/card/sam/', title: 'QR code of this card' });
318
+ ```
319
+
320
+ - `phone` is international (`+44 20 7946 0958`); `website` and the QR `url` are https.
321
+ - `photo` is `{ type: ContactPhotoType.Jpeg, base64 }`, JPEG or PNG only.
322
+ - `cardPath` ends with `/` and is the app's id, start URL and scope, so serve the page at that exact path.
323
+ - Serve the files as `text/vcard` and `application/manifest+json`.
324
+
325
+ ### The card (`ContactCard.astro`)
326
+
327
+ ```astro
328
+ <ContactCard
329
+ layout="name"
330
+ person={{ givenName, familyName, role, phone, email, website }}
331
+ brand={{ src, width, height, href: '/', label: 'Example Works, home' }}
332
+ portrait={{ src, width, height, alt }}
333
+ labels={labels}
334
+ saveHref="/card/sam.vcf"
335
+ cardUrl="https://example.test/card/sam/"
336
+ motion={{ openMotion: 'mark-lands', tiltMotion: 'card-leans', qrMotion: 'list-turns', saveMotion: 'tick' }}
337
+ brandMarkup={{ intro, still, wordmark }}
338
+ />
339
+ ```
340
+
341
+ - `layout` is `portrait`, `name` (default), `framed` or `honeycomb`. All four show the same information.
342
+ - `labels` is `ContactCardLabels`: every visible text, including the iPhone steps and the browser menu hint. `hideQr` (the Show my QR button while the QR is open) and `ready` (said and shown after Save contact, e.g. "Contact ready") are required.
343
+ - The card fills the screen and renders the page's `h1`. Give it a page without a site header.
344
+ - Save contact, call, email and website work without JavaScript. The QR and install buttons are hidden without it.
345
+ - Add to home screen uses the browser's prompt when offered, else shows help. It is hidden inside the installed app and right after installing; a browser tab opened later cannot tell.
346
+ - Colours: `--tmk-card-bg`, `-raised`, `-fill`, `-text`, `-heading`, `-text-soft`, `-line`, `-edge`, `-accent`, `-on-accent`. Also `--tmk-card-font`, `--tmk-card-radius`, `--tmk-card-qr-dark` and `--tmk-card-qr-light`. Set them on `:root`.
347
+ - Portrait crop: `--tmk-card-portrait-scale`, `-origin` and `-mask`.
348
+ - Line heights: `--tmk-card-name-line-height` (default `1.2`) and `--tmk-card-role-line-height` (default `1.3`), in every layout and while motion runs. Raise them for fonts with tall ascenders or descenders.
349
+ - `motion` has four settings; each left out takes the recommended one shown above, and an unknown value throws at build time. `openMotion`: `none`, `mark-first`, `mark-lands`, `written-in`. `tiltMotion`: `none`, `card-leans`, `portrait-leans`, `layers-drift`. `qrMotion`: `none`, `turn-over`, `cube-turn`, `list-turns`. `saveMotion`: `none`, `tick`, `light-crosses`, `cube-closes`. Under `prefers-reduced-motion` each shows its still end state. Show my QR and Add to home screen cannot be tapped until the opening has shown them. A sideways drag tilts the card and never follows a link it started on.
350
+ - `brandMarkup` is a mark from `@dloizides/logo-kit` (`intro` and `still` markup, optional `wordmark` `{ html, css }`); the opening draws it in. Without it the `brand` image is used.
351
+ - Data attributes: the card carries `data-layout`, `data-open-motion`, `data-tilt-motion`, `data-qr-motion` and `data-save-motion`; `data-tilting` is set while it leans. `data-part` names each part the motion moves.
352
+ - `mountContactCards(root, signal)` wires the buttons and the motion; aborting the signal removes every listener, frame loop and timer.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dloizides/marketing-astro-kit",
3
- "version": "1.11.0",
3
+ "version": "1.13.0",
4
4
  "description": "Reusable, themeable Astro marketing sections for product sites — a Free-vs-Pro pricing comparison table, a trust / credibility section (security cards, customer-logo + testimonial placeholders, discreet built-by), a client-side \"try it\" demo shell, a meeting request form posting to a contact endpoint, and an SEO guides/content-hub card + frontmatter schema. Data-driven via a shared TypeScript schema; themed entirely through the host site's CSS custom properties.",
5
5
  "keywords": [
6
6
  "astro",
@@ -24,7 +24,8 @@
24
24
  "cal.com",
25
25
  "meeting-request",
26
26
  "contact-form",
27
- "date-field"
27
+ "date-field",
28
+ "logo-intro"
28
29
  ],
29
30
  "author": "dloizides",
30
31
  "license": "MIT",
@@ -36,6 +37,7 @@
36
37
  "files": [
37
38
  "src",
38
39
  "!src/**/*.test.ts",
40
+ "!src/**/*.test-util.ts",
39
41
  "README.md",
40
42
  "CHANGELOG.md"
41
43
  ],
@@ -62,15 +64,21 @@
62
64
  "./DateField.astro": "./src/DateField.astro",
63
65
  "./dateField": "./src/dateField/index.ts",
64
66
  "./motionController": "./src/motionController/index.ts",
65
- "./scrollFade": "./src/scrollFade/index.ts"
67
+ "./scrollFade": "./src/scrollFade/index.ts",
68
+ "./logoIntro": "./src/logoIntro/index.ts",
69
+ "./ContactCard.astro": "./src/ContactCard.astro",
70
+ "./contactCard": "./src/contactCard/index.ts"
66
71
  },
67
72
  "scripts": {
68
73
  "test": "vitest run",
69
- "lint": "eslint src/bookingEmbed src/dateField src/meetingRequest src/motionController src/scrollFade --ext .ts",
70
- "typecheck": "tsc --noEmit -p ."
74
+ "lint": "eslint src/bookingEmbed src/dateField src/meetingRequest src/motionController src/scrollFade src/logoIntro src/contactCard --ext .ts",
75
+ "typecheck": "tsc --noEmit -p .",
76
+ "prepublishOnly": "npm run typecheck && npm run lint && npm test"
71
77
  },
72
78
  "dependencies": {
73
- "@lucasmarkes/hairline": "0.3.0"
79
+ "@dloizides/pwa-sw": "^1.11.0",
80
+ "@lucasmarkes/hairline": "0.3.0",
81
+ "qrcode-generator": "^2.0.4"
74
82
  },
75
83
  "devDependencies": {
76
84
  "@typescript-eslint/eslint-plugin": "^7.18.0",
@@ -78,6 +86,7 @@
78
86
  "eslint": "^8.57.1",
79
87
  "eslint-plugin-sonarjs": "^3.0.7",
80
88
  "jsdom": "^25.0.1",
89
+ "jsqr": "^1.4.0",
81
90
  "typescript": "^5.9.3",
82
91
  "vitest": "^2.1.9"
83
92
  },
@@ -86,6 +95,6 @@
86
95
  },
87
96
  "sideEffects": false,
88
97
  "engines": {
89
- "node": ">=18.0.0"
98
+ "node": ">=18.17.0"
90
99
  }
91
100
  }