@getvitops/emdash 2.0.0-alpha.3 → 2.0.0-alpha.5
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 +60 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +99 -19
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
- package/src/astro/MegaPanel.astro +25 -0
- package/src/astro/blocks/Accordion.astro +10 -1
- package/src/astro/blocks/Badges.astro +1 -1
- package/src/astro/blocks/Callout.astro +1 -1
- package/src/astro/blocks/Cards.astro +4 -3
- package/src/astro/blocks/Hero.astro +4 -3
- package/src/astro/blocks/Logos.astro +25 -0
- package/src/astro/blocks/Nav.astro +1 -1
- package/src/astro/blocks/Pricing.astro +4 -0
- package/src/astro/blocks/Reviews.astro +1 -1
- package/src/astro/blocks/Section.astro +41 -6
- package/src/astro/blocks/attrs.test.ts +4 -2
- package/src/astro/blocks/attrs.ts +1 -1
- package/src/astro/blocks/render.container.test.ts +83 -3
- package/src/astro/blocks/tone.test.ts +2 -2
- package/src/astro/blocks/tone.ts +9 -2
- package/src/astro/index.ts +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,65 @@
|
|
|
1
1
|
# @getvitops/emdash
|
|
2
2
|
|
|
3
|
+
## 2.0.0-alpha.5
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 4d94c8b: **Added: `site.chrome` — a configurable masthead and nav behaviour.** Non-breaking.
|
|
8
|
+
|
|
9
|
+
- `site.chrome.masthead` (new `@getvitops/config` schema): `position` (`static|sticky|fixed`), `behavior` (`always|hide-on-scroll`), `surface` (`solid|glass|transparent|transparent-until-scrolled`), `tone` (a `colors.roles` key), `layout` (`full|inset|floating`), `width`, `elevation` (`shadow`, `border`, `onScroll`), `height` and `inset`. `height` and `inset` take fluid lengths (`calc()`, `clamp()`, `min()`, `max()`, with `cqi`/`vw`/… units), checked against a closed grammar because they are written into CSS. `validateConfig` rejects a `tone` or `shadow` the design system does not define (only when the default theme states them directly, not via `extends`).
|
|
10
|
+
- `site.chrome.nav`: `compact` (`drawer|dropdown`), `drawerSide`, `breakpoint`/`mobileBreakpoint`/`megaBreakpoint`, `depth`, `megaDepth`.
|
|
11
|
+
- `<Masthead config={site}>` (`@getvitops/astro`, slots `brand`/default/`actions`) and `resolveMasthead()` / `resolveNavOptions()`. A prop overrides one field per layout. The key is `chrome`/`masthead` on purpose: `<header>` is valid in any section and `banner` already means the announcement bar and the landmark role.
|
|
12
|
+
- `<SiteNav>` gains `compact="dropdown"` (a columnar panel anchored under the toggle), `drawerSide` (previously hardcoded to the end edge in Astro), `megaDepth` and `megaPanel`. `.sitenav--mega` now styles second-level items as column headings and has an optional featured column.
|
|
13
|
+
- `@getvitops/emdash`: `VitopsMegaPanel` fills that column from the widget area `mega-<item url slug>` (or a `mega-area:<name>` class on the menu item). No area means no column.
|
|
14
|
+
- `@getvitops/create` (emdash template): the layout renders through `<Masthead>`; `site.json` ships a sticky glass masthead with a shadow once scrolled. The hand-written `.navbar { block-size: 64px }` is gone (use `masthead.height`).
|
|
15
|
+
- CSS (`patterns/masthead.css`, `patterns/sitenav.css`): **all formats**, including tailwind, where the patterns are inlined into `@layer components`. Hide-on-scroll and the `*-on-scroll` states are `scroll-state()` container queries that only subtract from a settled (solid, elevated, visible) bar, so a browser without them (Firefox today) shows that bar rather than a transparent one. A sticky or fixed masthead sets `--header-offset` / `--top-offset` so anchors land below it.
|
|
16
|
+
- `@getvitops/generator`: new `TIERS.masthead`; `TIERS.sitenav` documents the new props.
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies [785b8b3]
|
|
21
|
+
- Updated dependencies [bb61a35]
|
|
22
|
+
- Updated dependencies [4d94c8b]
|
|
23
|
+
- @getvitops/utils@8.3.0-alpha.5
|
|
24
|
+
- @getvitops/generator@8.3.0-alpha.5
|
|
25
|
+
|
|
26
|
+
## 2.0.0-alpha.4
|
|
27
|
+
|
|
28
|
+
### Minor Changes
|
|
29
|
+
|
|
30
|
+
- 99e66a2: Fixes from the vitops.ca build (alpha.3 findings 1–5, 19, 29).
|
|
31
|
+
|
|
32
|
+
- **Scaffold patterns.** Both templates now define `cta`, `link` and `details` in `patterns.items` (a `content` group too), and a `ui-accent` role. `.cta` had no CSS at all, so every hero, card and callout button rendered as plain text; a test now fails if a template omits a pattern the blocks emit. `vitops_accordion` renders a sprite chevron like `vitops_details`, and `details.css` styles an `.accordion` group (a divider and padded summaries from the `details` pattern tokens) — all formats.
|
|
33
|
+
- **Tone paints only on surfaces.** `.tone` now sets colour variables and `border-color`; the background comes from `.tone--tint` (callout, panel card, hero card, toned section/hero/nav/reviews, `theme`) or `.tone--solid`. A steps, stats or form block with a tone is no longer turned into a band. `ResolvedTone` gains `surface` (`tone tone--tint`). **If you styled `.tone` directly,** add `tone--tint` where you want the background. A `.cta` inside a tinted or filled tone takes the tone's solid. all formats.
|
|
34
|
+
- **`colors.tint: { mix: "8%" }`** derives the tint from the role's solid (`--tone-tint`) instead of its `muted` step, which turns brown for amber on a dark page. Off by default; not covered by the contrast contract.
|
|
35
|
+
- **Per-card backdrop.** `vitops_cards` and `vitops_hero` rows take a `theme` (tint or fill of a site colour), so one card of a pair can be tinted.
|
|
36
|
+
- **`colors.roles.<r>.acknowledgeContrast`**: a number of Lc a pairing may miss its APCA bar by and still only warn (e.g. pine's solid at Lc 59.5 against 60). A larger miss still fails.
|
|
37
|
+
- **Select:** where `appearance: base-select` is supported the wrapper's own chevron is hidden, so a select no longer shows two arrows, and the wrapper and control fill the field (`.custom-select` is `display: block`; add `display: inline-block` if you used it inline). all formats.
|
|
38
|
+
|
|
39
|
+
- d64fb20: Layout and spacing fixes from the vitops.ca build (findings 6–9).
|
|
40
|
+
|
|
41
|
+
- **`vitops_section` is the page opener.** New fields `cta_label`/`cta_href`/`secondary_label`/`secondary_href` (a `.cta` and a `.link` in the head), `*accent*` runs in the heading, and `stack: rhythm`, which puts `.rhythm` on `.section__inner` so head and body use the vertical-rhythm scale. With level 1 it replaces nesting a `vitops_hero` in a section, which rendered `section > .centered > … > section > .centered`. `vitops_hero` stays for a stand-alone hero with option cards. A plain (`stack: grid`) section also puts a gap between head and body now (`--section-gap`, default 2rem) instead of sitting flush. css/bricks/tailwind.
|
|
42
|
+
- **`.rhythm` spaces blocks.** A card row (`wc-cards`, classed `ul`/`ol`), accordion, `details`, form, table, figure or `.section__body` directly under a `.rhythm` is `--rhythm-block` (2) apart, not a paragraph apart; a button row (`p.cluster`) is `--rhythm-block-action` (1.6). Classless lists stay prose and a form's own field spacing is unchanged. A bare `<a>` that is a direct child of `.rhythm` is now `display: block; inline-size: fit-content`, since an inline box ignored `margin-top` and sat flush under the paragraph above (`.cta` and `.btn` are unaffected). all formats.
|
|
43
|
+
- **`rhythm-flex`** utility: an opt-in flex-column stack for the case the margin stack does not suit; margins apply to any child. all formats (`@utility` in tailwind).
|
|
44
|
+
|
|
45
|
+
- 322dd6a: Block fixes from the vitops.ca build (findings 11–13, 15, 17, 18, 21).
|
|
46
|
+
|
|
47
|
+
- **Steps.** The marker is an outlined disc in the tone (number and ring in `--tone-solid`, falling back to `currentColor`), so a steps block with no tone no longer shows black discs with no number. Items keep `align-content: start` and no `.rhythm li + li` margin, so markers in a row line up. Two modifiers through the block's `className`: `steps--cards` (each step in a card) and `steps--animated` (the connector draws and the marker fills as each step scrolls in; static under reduced motion or without scroll-driven animations). `steps` is now a config pattern: `patterns.items.steps` in `site.json` owns the card geometry (`content` group tokens) and the marker size (`--steps-marker-size`, `--steps-line-width`); both templates and the reference config ship an entry. all formats.
|
|
48
|
+
- **Stats.** `<wc-counter>` leaves a figure it cannot count as authored (`"1 in 6"`, `"24/7"`, `"—"`) instead of counting down from zero to a wrong value. `animate: false` on the block still turns the count-up off for a whole block.
|
|
49
|
+
- **Logos.** `vitops_logos` takes an optional `kicker`, `note` and `linkLabel`/`linkHref`; with any of them set, the row is wrapped in `.logos-block`. The list keeps the block's attributes either way.
|
|
50
|
+
- **Pricing.** Plans take `yearly` (a second price line) and `note` (under the plan name).
|
|
51
|
+
- **`<SiteFooter>`** has a `brand` named slot, rendered as the first column (`.sitefooter__brand`) in the site's own markup.
|
|
52
|
+
|
|
53
|
+
### Patch Changes
|
|
54
|
+
|
|
55
|
+
- Updated dependencies [99e66a2]
|
|
56
|
+
- Updated dependencies [00a9d86]
|
|
57
|
+
- Updated dependencies [d64fb20]
|
|
58
|
+
- Updated dependencies [322dd6a]
|
|
59
|
+
- Updated dependencies [322dd6a]
|
|
60
|
+
- @getvitops/generator@8.3.0-alpha.4
|
|
61
|
+
- @getvitops/utils@8.3.0-alpha.4
|
|
62
|
+
|
|
3
63
|
## 2.0.0-alpha.3
|
|
4
64
|
|
|
5
65
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -82,6 +82,8 @@ export declare function toneChain(tone: unknown): string[];
|
|
|
82
82
|
interface ResolvedTone {
|
|
83
83
|
/** Always `tone`; a block adds `tone--solid` itself when it fills rather than tints. */
|
|
84
84
|
className: string;
|
|
85
|
+
/** `tone tone--tint`: what a block that is a surface (callout, card, band) puts on its root. */
|
|
86
|
+
surface: string;
|
|
85
87
|
/** Inline `style` value of `--tone-*` properties (no trailing semicolon). Empty when unset. */
|
|
86
88
|
style: string;
|
|
87
89
|
}
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/blocks.ts","../src/design-system-route.ts","../src/blocks-doc.ts","../src/form-template.ts","../src/block-types.ts","../src/astro/blocks/tone.ts","../src/hosting.ts","../src/index.ts"],"mappings":";;;KAwBY,mBAAmB,QAC7B,YAAY;EAEV;;KAWQ,uBAAuB,KAAK;EACtC,SAAS;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/blocks.ts","../src/design-system-route.ts","../src/blocks-doc.ts","../src/form-template.ts","../src/block-types.ts","../src/astro/blocks/tone.ts","../src/hosting.ts","../src/index.ts"],"mappings":";;;KAwBY,mBAAmB,QAC7B,YAAY;EAEV;;KAWQ,uBAAuB,KAAK;EACtC,SAAS;;qBAqnCE,QAAQ;;UAMJ;;EAEf;;EAEA;;;;;;;EAOA,QAAQ;;;;;;;;wBASM,aAAa,YAAW,iBAAsB;UC/nC7C;;;;;;;;EAQf;;EAEA;;;;;;;wBC9Bc,gBAAgB,kBAAiB;;UCjBhC;EACf;EACA;EACA;EACA;EACA;IAAY;IAAe;;;UAGZ;EACf;EACA;EACA;EACA;EACA,QAAQ;;;wBAIM,sBAAsB,iBAAiB;;qBCZ1C;;qBA8EA,oBAAoB;;;;;;wBAejB,oBAAoB;;wBC/DpB,UAAU;UAcT;;EAEf;;EAEA;;EAEA;;;;;;;;wBASc,YAAY,gBAAgB,kBAAkB;KClDlD;UAIK;;EAEf,SAAS;EACT;;IAEE;;IAEA;;IAEA;;;;;;;IAOA;;EAEF;;IAEE;;IAEA;;IAEA;;IAEA;;;UAIa;EACf,QAAQ;EACR,SAAS;;EAET;;EAEA;;wBAoBoB,cAAc,UAAS,uBAA4B,QAAQ;iBCfhE;;;;;;;;;;;EAWf;;EAEA;;;;;;;;;EASA,qBAAqB;;;;;;EAMrB,SAAS;;;;;;;EAOT;;;;;;wBAOc,aAAa,UAAS,sBAA2B;;wBAmBjD,aAAa,UAAS,uCAAwB,gCAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -109,6 +109,7 @@ function resolveTone(tone, color) {
|
|
|
109
109
|
const flip = (light, dark) => `light-dark(${at(light)}, ${at(dark)})`;
|
|
110
110
|
return {
|
|
111
111
|
className: "tone",
|
|
112
|
+
surface: "tone tone--tint",
|
|
112
113
|
style: [
|
|
113
114
|
`--tone-bg: ${flip("100", "900")}`,
|
|
114
115
|
`--tone-fg: ${flip("900", "100")}`,
|
|
@@ -120,12 +121,14 @@ function resolveTone(tone, color) {
|
|
|
120
121
|
}
|
|
121
122
|
if (!hasTone) return {
|
|
122
123
|
className: "tone",
|
|
124
|
+
surface: "tone",
|
|
123
125
|
style: ""
|
|
124
126
|
};
|
|
125
127
|
const roles = toneChain(tone);
|
|
126
128
|
const of = (prefix, suffix = "") => chain(roles.map((r) => `--color-${prefix}-${r}${suffix}`));
|
|
127
129
|
return {
|
|
128
130
|
className: "tone",
|
|
131
|
+
surface: "tone tone--tint",
|
|
129
132
|
style: [
|
|
130
133
|
`--tone-bg: ${of("bg", "-muted")}`,
|
|
131
134
|
`--tone-fg: ${of("text")}`,
|
|
@@ -191,6 +194,26 @@ const SECTION_FIELDS = [
|
|
|
191
194
|
label: "Lead-in text under the heading",
|
|
192
195
|
type: "text"
|
|
193
196
|
},
|
|
197
|
+
{
|
|
198
|
+
slug: "cta_label",
|
|
199
|
+
label: "Button text (filled)",
|
|
200
|
+
type: "string"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
slug: "cta_href",
|
|
204
|
+
label: "Button URL",
|
|
205
|
+
type: "string"
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
slug: "secondary_label",
|
|
209
|
+
label: "Second link text",
|
|
210
|
+
type: "string"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
slug: "secondary_href",
|
|
214
|
+
label: "Second link URL",
|
|
215
|
+
type: "string"
|
|
216
|
+
},
|
|
194
217
|
{
|
|
195
218
|
slug: "body",
|
|
196
219
|
label: "Content (any blocks)",
|
|
@@ -201,6 +224,7 @@ const SECTION_FIELDS = [
|
|
|
201
224
|
"center",
|
|
202
225
|
"split"
|
|
203
226
|
], "stack"),
|
|
227
|
+
select("stack", "Spacing (rhythm: head and body use the vertical-rhythm scale, as a page opener or prose stack)", ["grid", "rhythm"], "grid"),
|
|
204
228
|
select("width", "Width", [
|
|
205
229
|
"measure",
|
|
206
230
|
"breakout",
|
|
@@ -1028,6 +1052,26 @@ const BASE_BLOCKS = [
|
|
|
1028
1052
|
label: "Accessible name",
|
|
1029
1053
|
initial_value: "Partners"
|
|
1030
1054
|
},
|
|
1055
|
+
{
|
|
1056
|
+
type: "text_input",
|
|
1057
|
+
action_id: "kicker",
|
|
1058
|
+
label: "Line above the row (optional)"
|
|
1059
|
+
},
|
|
1060
|
+
{
|
|
1061
|
+
type: "text_input",
|
|
1062
|
+
action_id: "note",
|
|
1063
|
+
label: "Closing note under the row (optional)"
|
|
1064
|
+
},
|
|
1065
|
+
{
|
|
1066
|
+
type: "text_input",
|
|
1067
|
+
action_id: "linkLabel",
|
|
1068
|
+
label: "Link text under the row (optional)"
|
|
1069
|
+
},
|
|
1070
|
+
{
|
|
1071
|
+
type: "text_input",
|
|
1072
|
+
action_id: "linkHref",
|
|
1073
|
+
label: "Link URL"
|
|
1074
|
+
},
|
|
1031
1075
|
{
|
|
1032
1076
|
type: "repeater",
|
|
1033
1077
|
action_id: "logos",
|
|
@@ -1316,6 +1360,16 @@ const BASE_BLOCKS = [
|
|
|
1316
1360
|
action_id: "period",
|
|
1317
1361
|
label: "Period (e.g. per month)"
|
|
1318
1362
|
},
|
|
1363
|
+
{
|
|
1364
|
+
type: "text_input",
|
|
1365
|
+
action_id: "yearly",
|
|
1366
|
+
label: "Yearly price line (e.g. $34 paid yearly), shown under the price"
|
|
1367
|
+
},
|
|
1368
|
+
{
|
|
1369
|
+
type: "text_input",
|
|
1370
|
+
action_id: "note",
|
|
1371
|
+
label: "Note under the plan name (e.g. Best for small teams)"
|
|
1372
|
+
},
|
|
1319
1373
|
{
|
|
1320
1374
|
type: "text_input",
|
|
1321
1375
|
action_id: "features",
|
|
@@ -1830,23 +1884,44 @@ const ROW_TONE = {
|
|
|
1830
1884
|
vitops_hero: "cards"
|
|
1831
1885
|
};
|
|
1832
1886
|
/** Extra row fields for one repeater, beyond the shared tone pair. */
|
|
1833
|
-
const
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
label: "
|
|
1843
|
-
|
|
1844
|
-
{
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1887
|
+
const rowThemeField = () => ({
|
|
1888
|
+
type: "select",
|
|
1889
|
+
action_id: "theme",
|
|
1890
|
+
label: "Backdrop for this item (a tint or fill of a site colour; wins over tone)",
|
|
1891
|
+
initial_value: "",
|
|
1892
|
+
options: [{
|
|
1893
|
+
label: "None",
|
|
1894
|
+
value: ""
|
|
1895
|
+
}, ...THEME_ROLES.flatMap((r) => [{
|
|
1896
|
+
label: r.replace(/-/g, " "),
|
|
1897
|
+
value: r
|
|
1898
|
+
}, {
|
|
1899
|
+
label: `${r.replace(/-/g, " ")} (filled)`,
|
|
1900
|
+
value: `${r}:solid`
|
|
1901
|
+
}])],
|
|
1902
|
+
optionsRoute: THEMES_ROUTE
|
|
1903
|
+
});
|
|
1904
|
+
const ROW_EXTRA = {
|
|
1905
|
+
vitops_cards: { cards: [rowThemeField()] },
|
|
1906
|
+
vitops_hero: { cards: [
|
|
1907
|
+
rowThemeField(),
|
|
1908
|
+
{
|
|
1909
|
+
type: "text_input",
|
|
1910
|
+
action_id: "eyebrow",
|
|
1911
|
+
label: "Eyebrow (small line above the title)"
|
|
1912
|
+
},
|
|
1913
|
+
{
|
|
1914
|
+
type: "text_input",
|
|
1915
|
+
action_id: "ctaLabel",
|
|
1916
|
+
label: "Button text"
|
|
1917
|
+
},
|
|
1918
|
+
{
|
|
1919
|
+
type: "text_input",
|
|
1920
|
+
action_id: "ctaHref",
|
|
1921
|
+
label: "Button URL"
|
|
1922
|
+
}
|
|
1923
|
+
] }
|
|
1924
|
+
};
|
|
1850
1925
|
const rowToneFields = () => [{
|
|
1851
1926
|
type: "select",
|
|
1852
1927
|
action_id: "tone",
|
|
@@ -2179,7 +2254,9 @@ function renderBlocksDoc(blocks = BLOCKS) {
|
|
|
2179
2254
|
"class built from the value. Rows of `hero.cards`, `cards`, `stats` and `steps` (and `badges.items`)",
|
|
2180
2255
|
"take their own `tone`/`color`; blank inherits the block's, and a row's colour never reaches its",
|
|
2181
2256
|
"siblings, so mixed colours need no extra block. Multiline fields that accept links take",
|
|
2182
|
-
"`[text](/url)`; hero headings accent words wrapped in `*stars
|
|
2257
|
+
"`[text](/url)`; hero and section headings accent words wrapped in `*stars*` (coloured by the",
|
|
2258
|
+
"`ui-accent` role, or `--accent-color` in the block's `style`). `hero.cards` and `cards` rows also take a",
|
|
2259
|
+
"`theme` (a tint or fill of a site colour) so one card can differ from its neighbours.",
|
|
2183
2260
|
"",
|
|
2184
2261
|
"## Theme",
|
|
2185
2262
|
"",
|
|
@@ -2193,6 +2270,9 @@ function renderBlocksDoc(blocks = BLOCKS) {
|
|
|
2193
2270
|
"configured size, so one block can resize its titles through its `style` field",
|
|
2194
2271
|
"(`--heading-fs: 1.125rem`) with no site CSS; set it on an ancestor to resize a region. It is inherited,",
|
|
2195
2272
|
"so it reaches every use of that role inside the block. `style` accepts custom properties only.",
|
|
2273
|
+
"Steps take two modifiers through `className`: `steps--cards` (each step in a card; its geometry is the",
|
|
2274
|
+
"`steps` entry of `patterns.items` in site.json) and `steps--animated` (the connector draws and the marker fills",
|
|
2275
|
+
"on scroll; static with reduced motion). `rhythm-flex` is an opt-in flex stack for any block.",
|
|
2196
2276
|
"Steps, stats and cards also have per-part hooks: `--steps-title-size` (default one step below the",
|
|
2197
2277
|
"heading role), `--stats-figure-size` and `--card-title-size`.",
|
|
2198
2278
|
""
|
|
@@ -2433,7 +2513,7 @@ async function vitopsHosting(options = {}) {
|
|
|
2433
2513
|
}
|
|
2434
2514
|
|
|
2435
2515
|
// package.json
|
|
2436
|
-
var version = "2.0.0-alpha.
|
|
2516
|
+
var version = "2.0.0-alpha.5";
|
|
2437
2517
|
|
|
2438
2518
|
// src/index.ts
|
|
2439
2519
|
/**
|