@getvitops/emdash 2.0.0-alpha.2 → 2.0.0-alpha.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/CHANGELOG.md CHANGED
@@ -1,5 +1,49 @@
1
1
  # @getvitops/emdash
2
2
 
3
+ ## 2.0.0-alpha.4
4
+
5
+ ### Minor Changes
6
+
7
+ - 99e66a2: Fixes from the vitops.ca build (alpha.3 findings 1–5, 19, 29).
8
+
9
+ - **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.
10
+ - **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.
11
+ - **`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.
12
+ - **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.
13
+ - **`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.
14
+ - **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.
15
+
16
+ - d64fb20: Layout and spacing fixes from the vitops.ca build (findings 6–9).
17
+
18
+ - **`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.
19
+ - **`.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.
20
+ - **`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).
21
+
22
+ - 322dd6a: Block fixes from the vitops.ca build (findings 11–13, 15, 17, 18, 21).
23
+
24
+ - **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.
25
+ - **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.
26
+ - **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.
27
+ - **Pricing.** Plans take `yearly` (a second price line) and `note` (under the plan name).
28
+ - **`<SiteFooter>`** has a `brand` named slot, rendered as the first column (`.sitefooter__brand`) in the site's own markup.
29
+
30
+ ### Patch Changes
31
+
32
+ - Updated dependencies [99e66a2]
33
+ - Updated dependencies [00a9d86]
34
+ - Updated dependencies [d64fb20]
35
+ - Updated dependencies [322dd6a]
36
+ - Updated dependencies [322dd6a]
37
+ - @getvitops/generator@8.3.0-alpha.4
38
+ - @getvitops/utils@8.3.0-alpha.4
39
+
40
+ ## 2.0.0-alpha.3
41
+
42
+ ### Patch Changes
43
+
44
+ - @getvitops/generator@8.3.0-alpha.3
45
+ - @getvitops/utils@8.3.0-alpha.3
46
+
3
47
  ## 2.0.0-alpha.2
4
48
 
5
49
  ### Major 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
  }
@@ -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;;qBAqlCE,QAAQ;;UAMJ;;EAEf;;EAEA;;;;;;;EAOA,QAAQ;;;;;;;;wBASM,aAAa,YAAW,iBAAsB;UC/lC7C;;;;;;;;EAQf;;EAEA;;;;;;;wBC9Bc,gBAAgB,kBAAiB;;UCjBhC;EACf;EACA;EACA;EACA;EACA;IAAY;IAAe;;;UAGZ;EACf;EACA;EACA;EACA;EACA,QAAQ;;;wBAIM,sBAAsB,iBAAiB;;qBCZ1C;;qBAoEA,oBAAoB;;;;;;wBAejB,oBAAoB;;wBCrDpB,UAAU;UAcT;;EAEf;;EAEA;;;;;;;;wBASc,YAAY,gBAAgB,kBAAkB;KChDlD;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"}
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 ROW_EXTRA = { vitops_hero: { cards: [
1834
- {
1835
- type: "text_input",
1836
- action_id: "eyebrow",
1837
- label: "Eyebrow (small line above the title)"
1838
- },
1839
- {
1840
- type: "text_input",
1841
- action_id: "ctaLabel",
1842
- label: "Button text"
1843
- },
1844
- {
1845
- type: "text_input",
1846
- action_id: "ctaHref",
1847
- label: "Button URL"
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.2";
2516
+ var version = "2.0.0-alpha.4";
2437
2517
 
2438
2518
  // src/index.ts
2439
2519
  /**