@dloizides/marketing-astro-kit 1.6.1 → 1.7.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.
- package/CHANGELOG.md +6 -0
- package/README.md +4 -0
- package/package.json +4 -2
- package/src/BottomSheet.astro +26 -0
- package/src/bottomSheet.css +15 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.7.0
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- `<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".
|
|
8
|
+
|
|
3
9
|
## 1.6.1
|
|
4
10
|
|
|
5
11
|
### Fixed
|
package/README.md
CHANGED
|
@@ -185,6 +185,10 @@ import HairlineFigure from '@dloizides/marketing-astro-kit/HairlineFigure.astro'
|
|
|
185
185
|
- **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`.
|
|
186
186
|
- **Vite-alias consumers** (the kit aliased to source, not installed) must have `@lucasmarkes/hairline@0.3.0` resolvable from the site.
|
|
187
187
|
|
|
188
|
+
## Bottom sheet (`BottomSheet`)
|
|
189
|
+
|
|
190
|
+
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`.
|
|
191
|
+
|
|
188
192
|
## Theming contract
|
|
189
193
|
|
|
190
194
|
The components read these CSS vars off the host `:root` (each has a sensible
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dloizides/marketing-astro-kit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.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, 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",
|
|
@@ -46,7 +46,9 @@
|
|
|
46
46
|
"./heroBackdrop": "./src/heroBackdrop/presets.ts",
|
|
47
47
|
"./heroBackdrop/types": "./src/heroBackdrop/types.ts",
|
|
48
48
|
"./HairlineFigure.astro": "./src/HairlineFigure.astro",
|
|
49
|
-
"./hairline": "./src/hairline/figures.ts"
|
|
49
|
+
"./hairline": "./src/hairline/figures.ts",
|
|
50
|
+
"./BottomSheet.astro": "./src/BottomSheet.astro",
|
|
51
|
+
"./bottomSheet.css": "./src/bottomSheet.css"
|
|
50
52
|
},
|
|
51
53
|
"dependencies": {
|
|
52
54
|
"@lucasmarkes/hairline": "0.3.0"
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
import './bottomSheet.css';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
id: string;
|
|
6
|
+
title: string;
|
|
7
|
+
closeLabel: string;
|
|
8
|
+
testId?: string;
|
|
9
|
+
closeTestId?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const { id, title, closeLabel, testId, closeTestId } = Astro.props;
|
|
13
|
+
const titleId = `${id}-title`;
|
|
14
|
+
---
|
|
15
|
+
<div class="tmk-sheet" id={id} role="group" aria-labelledby={titleId} data-testid={testId}>
|
|
16
|
+
<div class="tmk-sheet-head">
|
|
17
|
+
<div class="tmk-sheet-title" id={titleId}>{title}</div>
|
|
18
|
+
<a class="tmk-sheet-close" href="#" aria-label={closeLabel} data-sheet-close data-testid={closeTestId}>
|
|
19
|
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M6 6l12 12M18 6L6 18" /></svg>
|
|
20
|
+
</a>
|
|
21
|
+
</div>
|
|
22
|
+
<slot />
|
|
23
|
+
<div class="tmk-sheet-foot">
|
|
24
|
+
<slot name="foot" />
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
.tmk-sheet-head,.tmk-sheet-foot{display:none}
|
|
2
|
+
.tmk-sheet{display:contents}
|
|
3
|
+
|
|
4
|
+
@media (max-width:1023.98px){
|
|
5
|
+
.tmk-sheet{display:block;position:fixed;left:0;right:0;bottom:var(--dlz-consent-inset,0px);max-height:calc(80vh - var(--dlz-consent-inset,0px));overflow:auto;background:var(--tmk-sheet-bg,var(--paper,Canvas));border-top:2px solid var(--tmk-sheet-edge,var(--ink,CanvasText));border-radius:10px 10px 0 0;padding:12px 16px 0;transform:translateY(calc(105% + var(--dlz-consent-inset,0px)));visibility:hidden;z-index:30;transition:transform 240ms ease-out,visibility 0s linear 240ms}
|
|
6
|
+
.tmk-sheet:target{transform:none;visibility:visible;transition:transform 240ms ease-out,visibility 0s}
|
|
7
|
+
.tmk-sheet-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
|
|
8
|
+
.tmk-sheet-title{font-size:17px;line-height:1.25;font-weight:700}
|
|
9
|
+
.tmk-sheet-close{min-width:44px;min-height:44px;display:inline-flex;align-items:center;justify-content:center;color:inherit}
|
|
10
|
+
.tmk-sheet-foot{display:block;position:sticky;bottom:0;background:var(--tmk-sheet-bg,var(--paper,Canvas));padding:12px 0 16px}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@media (prefers-reduced-motion:reduce){
|
|
14
|
+
.tmk-sheet,.tmk-sheet:target{transition:none}
|
|
15
|
+
}
|