@getvitops/core 6.0.0 → 8.0.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 CHANGED
@@ -1,5 +1,330 @@
1
1
  # @getvitops/core
2
2
 
3
+ ## 8.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - Rebuild the lightbox on one dialog + the existing carousel, fixing the flicker on
8
+ prev/next and the stutter on open.
9
+
10
+ **Breaking (`css`/`bricks` and `tailwind` formats — `.lightbox-dialog`'s markup
11
+ contract changed):**
12
+
13
+ - `<Gallery />` now emits ONE `<dialog class="lightbox-dialog">` per gallery,
14
+ wrapping a `<Carousel />`, instead of one dialog per image. A `.gallery__trigger`
15
+ is now a plain `<a href="#slide-id">`, not a `command="show-modal"` button.
16
+ - `.lightbox-dialog__content` / `__image` / `__nav` / `__nav-button` /
17
+ `__caption` are gone. The dialog's child is `.lightbox-dialog__track` (a
18
+ `.carousel`) — prev/next, dots, arrow keys and swipe are the carousel's,
19
+ reused rather than reimplemented. `.lightbox-dialog__close` is unchanged.
20
+ - `<wc-gallery>` no longer builds nav buttons or steps between images — the
21
+ nested `<wc-carousel>` does. It fires `gallery-open` (unchanged shape) and
22
+ re-emits the carousel's own stepping as `gallery-change`.
23
+ - `packages/core/src/web-components/utils/gallery.ts` dropped `keyToAction` and
24
+ `swipeAction` (the carousel's own key/swipe handling covers both now).
25
+ `stepIndex`/`preloadTargets` are unchanged.
26
+
27
+ **Why:** stepping used to close one `<dialog>` and open another, which made
28
+ `animation.css`'s top-layer driver play a full exit-then-entry transition on
29
+ every step — visible as a flicker on prev/next, by construction, not a bug to
30
+ tune away. Opening also awaited the full image's `decode()` before starting the
31
+ view-transition morph, so the dialog visibly stalled on a slow network. One
32
+ dialog containing one carousel makes the first failure mode unrepresentable
33
+ (stepping is a scroll, not a close/open pair) and removes the wait for the
34
+ second (the morph starts immediately, painting the thumbnail as a CSS
35
+ background placeholder until the full image arrives).
36
+
37
+ **Also improved, not just fixed:** the no-JS fallback is no longer a _stripped_
38
+ lightbox — it's a genuine one. Each trigger is ordinary fragment navigation
39
+ (`:has(:target)` in `lightbox.css` reveals the dialog), which needs no Invoker
40
+ Commands polyfill in any engine, and it now has working prev/next with no
41
+ JavaScript at all — the previous per-dialog fallback had no way to express that.
42
+
43
+ **Migration:** a consumer using `<Gallery />` needs no changes — the component's
44
+ props are unchanged. Anyone who hand-authored `.lightbox-dialog` markup (per
45
+ `docs/concepts/patterns.md` / `docs/css/classes.md`) must move to the new single-
46
+ dialog-wrapping-a-carousel shape; see `patterns.astro`'s "Gallery, hand-authored"
47
+ demo for the reference markup. `<wc-gallery>` consumers listening for
48
+ `gallery-change` keep the same event shape (`{ index, total }`).
49
+
50
+ ### Minor Changes
51
+
52
+ - Add Google Business Profile reviews: fetch, cache, render.
53
+
54
+ - **`vitops reviews`** (new CLI command) fetches a client's GBP reviews (legacy v4 API — the only
55
+ one that has them) and writes them to `.vitops/reviews.json`, meant to be committed so a build
56
+ never needs a live Google credential. `--dry` prints the plan; `--check` diffs against the cache
57
+ without writing. Requires the same `VITOPS_GOOGLE_CLIENT_ID`/`_CLIENT_SECRET`/`_REFRESH_TOKEN` (or
58
+ ADC login) `search setup` uses, scoped to `business.manage` — **and the calling GCP project must
59
+ be allowlisted by Google first**, a separate one-time approval from every other Google API here.
60
+ - **`site.reviews`** (config): which `organization.locations` to fetch, and per-location
61
+ `featured`/`minRating`/`sort`/`limit` selection. `schema` (JSON-LD) and `avatars` both default to
62
+ **off** — see the migration notes below.
63
+ - **`@getvitops/utils/reviews`** (new subpath): the pure plan/select/merge functions plus the GBP
64
+ fetcher and cache reader/writer, mirroring `./indexing`'s pure/IO split.
65
+ - **`<ReviewCard>`** (new Astro component, `@getvitops/astro`): one review card from a cache entry.
66
+ No web component — nothing here needs progressive enhancement. Composes the existing
67
+ `schemas/Review.astro` for JSON-LD only when both `schema` and `itemReviewed` are passed.
68
+ - **`<Marquee>`** (new Astro component): the tier-3 wrapper `wc-marquee`/`marquee.css` was missing.
69
+ - **`.review` pattern** (`css`/`bricks` and `tailwind` formats): a new config-generated
70
+ `patterns.items.review` entry plus `packages/core/css/patterns/review.css` for the structural
71
+ parts (rating, identity, body, reply, source link). Two new semantic icon names, `star` and
72
+ `star-half`, across every icon set.
73
+
74
+ **Migration:** no breaking change. A site adding `site.reviews` should read the "Google reviews"
75
+ section in AGENTS.md before enabling `schema` — Google's structured-data policy treats a business
76
+ marking up reviews of itself as ineligible for review rich results and risks a manual action, which
77
+ is why it defaults off.
78
+
79
+ - Repo-wide simplification pass: de-boilerplate the CLI, dedupe shared cache/plan
80
+ primitives in `@getvitops/utils`, drop dead code, and tighten dependency hygiene.
81
+
82
+ No breaking changes. (`vitops icons`'s `--site` flag was briefly going to be renamed to
83
+ `--input` for consistency with the other `Config`-anchored commands — deferred rather than
84
+ spending a major bump on a rename with no other breaking change riding along; it stays
85
+ `--site` for now.)
86
+
87
+ **Fixed:**
88
+
89
+ - `@getvitops/core`'s 12 runtime deps (`lit`, both `@oddbird` polyfills, both
90
+ `@webcomponents` packages, `colorjs.io`, etc.) were listed as `dependencies` despite
91
+ being bundled into `dist/elements.js`/`dist/polyfills.js`/`dist/deferred.js` — a
92
+ consumer installed them twice for nothing. Moved to `devDependencies`; no change to
93
+ what ships.
94
+ - Deleted `old-css-lib/` (59 files), superseded by `packages/core/css/` since the
95
+ in-memory bundling change — no consumer-facing effect, it was not part of any
96
+ published output.
97
+ - Deleted a dead Astro module (`packages/astro/src/scripts/deferred.ts`) that had
98
+ silently diverged from `packages/core/src/js/deferred.ts` and had zero importers.
99
+
100
+ **No consumer-facing change in `@getvitops/vite`** beyond the fixed-group version bump —
101
+ task-graph and caching fixes internal to this repo's own build.
102
+
103
+ Everything else (the `cli.ts` file split into `commands/{search,ads}.ts`, shared
104
+ `json-store.ts`/`plan-format.ts` helpers in `@getvitops/utils`, a `.github/actions/setup`
105
+ composite action, restatement-comment cleanup) is internal refactoring with no change to
106
+ any published API, CLI flag, or generated output.
107
+
108
+ ## 7.0.0
109
+
110
+ ### Major Changes
111
+
112
+ - aad43b7: A gallery/lightbox that is a fully working modal lightbox with **zero JavaScript**, plus
113
+ `ImageMetadata` support in `<Carousel />`.
114
+
115
+ Only `@getvitops/core`, `generator` and `astro` change here. This changeset makes **no
116
+ consumer-facing change** to `utils`, `cli` or `vite` — they still ship in this release because
117
+ the six share one version, but from a different changeset (`localbusiness-schema.md`) that
118
+ touches `utils` and `generator` for an unrelated reason.
119
+
120
+ **Breaking — `css`/`bricks`/`tailwind` (all formats):** the `.lightbox` thumbnail grid is now
121
+ `.gallery`, so it composes with the dialog it opens (`.lightbox-dialog`, unchanged) rather than
122
+ sharing its name. `vitops lint --fix` cannot cover this: `movedTokens()` renames colour token
123
+ names only, and there is no class-rename mechanism in `@getvitops/cli`. Migrate by hand:
124
+
125
+ | Old | New |
126
+ | ------------------ | ----------------- |
127
+ | `.lightbox` | `.gallery` |
128
+ | `.lightbox__item` | `.gallery__item` |
129
+ | `.lightbox__thumb` | `.gallery__thumb` |
130
+
131
+ `.lightbox-dialog` and its `__content` / `__image` / `__close` / `__nav` / `__nav-button` /
132
+ `__caption` parts are unchanged.
133
+
134
+ **Added — `css`/`bricks`/`tailwind` (all formats):** `patterns/gallery.css` — the `.gallery` grid,
135
+ now on the token cascade (`--br-gallery` etc.) it only half-had before.
136
+
137
+ **Added — `wc`:** `<wc-gallery>` (`@getvitops/core/elements`). Wraps a `.gallery` grid of
138
+ `command="show-modal"` triggers and the `.lightbox-dialog`s they open. With no JS, each trigger is
139
+ a real Invoker Commands button for its own dialog — open and close both work. `<wc-gallery>` adds
140
+ what the fallback deliberately cannot contain: prev/next, arrow keys, swipe (horizontal to step,
141
+ vertical to dismiss), an announced image counter, neighbour preload, and a thumbnail → full-image
142
+ `document.startViewTransition` morph where supported. Prev/next can't exist in the fallback — a
143
+ second `show-modal` invoker inside an already-open dialog stacks a second modal rather than
144
+ replacing the first — so it is generated by the element, never authored, the same rule
145
+ `<wc-tree>`'s search field follows.
146
+
147
+ **Added — `astro`:** `<Gallery />` (`@getvitops/astro/components/Gallery.astro`) — emits a
148
+ `.gallery` grid plus one `.lightbox-dialog` per image and its own `<wc-gallery>`; do not wrap it in
149
+ one. Images take `string | ImageMetadata`, rendered through a new internal `<ResponsiveImage />`
150
+ helper: a plain string renders the same raw `<img>` every component here used before, unchanged;
151
+ an `astro:assets` import renders through `<Picture />` for AVIF/WebP derivatives.
152
+
153
+ **Changed — `astro`:** `<Carousel />`'s `CarouselSlide.src` now also accepts `ImageMetadata`,
154
+ through the same `<ResponsiveImage />` helper, plus a new `formats` prop. Every existing
155
+ string-`src` call site renders byte-identical markup — purely additive.
156
+
157
+ **Added — `wc`:** the Invoker Commands API (`<button command commandfor>`) polyfill
158
+ (`invokers-polyfill`, feature-detected via `@getvitops/core/polyfills`) — resolves the TODO
159
+ `polyfills.ts` carried since 4.0. `<wc-gallery>`'s fallback and `<Drawer />` (which already emitted
160
+ `command="show-modal"` unconditionally) both now get real cross-browser coverage rather than
161
+ depending on it being "too new to rely on yet." Fetched only in an engine that doesn't support the
162
+ API natively, so a current browser downloads none of it.
163
+
164
+ **Migration:** rename `.lightbox` → `.gallery` and `.lightbox__item`/`.lightbox__thumb` →
165
+ `.gallery__item`/`.gallery__thumb` wherever authored (see table above); everything else is
166
+ additive. Consumers using the CSS pattern with no JS need no other change — the fallback markup is
167
+ unchanged in shape, only the class names moved.
168
+
169
+ - eb9ac79: `<wc-tree>` gains WAI-ARIA tree semantics and roving-tabindex keyboard navigation, and the
170
+ keyboard-navigation code behind it lands as shared utilities the next roving-tabindex component
171
+ (Dropdown, Tabs, Combobox) can reuse.
172
+
173
+ **Breaking — `wc` (`@getvitops/core`).** On upgrade, `<wc-tree>` now unwraps every branch's
174
+ `<details>`/`<summary>` into a plain, JS-owned structure (`role="tree"` on the root,
175
+ `role="treeitem"` on every item, `role="group"` on every nested list, a roving `tabindex`, and
176
+ `aria-expanded` mirroring expand state). This is a deliberate, named exception to the framework's
177
+ normal "parse the fallback and augment it in place" rule — the alternative, an ARIA-attribute
178
+ overlay left on top of the native `<details>`/`<summary>` structure, was tried first and rejected
179
+ because `<summary>` stays focusable regardless, which leaves a permanent duplicate `role="button"`
180
+ node inside every branch. The no-JS fallback is completely unaffected: it is still native nested
181
+ `<details>`, exactly as `<Tree />` has always rendered it, and `enhance={false}` still gets the
182
+ bare fragment with no `<wc-tree>` at all.
183
+
184
+ Two concrete things break for a consumer that reached into the enhanced DOM directly:
185
+ - A script holding a reference to the original `<details>`/`<summary>` nodes — including one
186
+ captured via `getElementById` before upgrade, since the flat markup shape's `<details>` carries
187
+ the item's `id` — loses that reference once JS runs. `tree-toggle` (mirroring the existing
188
+ `tree-filter` custom event) is the replacement surface for reacting to expand/collapse.
189
+ - `<wc-tree>` becomes a single tab stop. Tabbing through every row in a large tree no longer
190
+ works; arrow keys replace it (Up/Down between visible nodes, Right/Left to open/close a branch or
191
+ step in/out, Home/End, type-ahead), matching the WAI-ARIA tree pattern. Left/Right flip under
192
+ `direction: rtl`.
193
+
194
+ **Fixed — `wc` (`@getvitops/core`).** `<wc-carousel>`'s dot-nav arrow keys now follow writing
195
+ direction. In an RTL document, `ArrowLeft` moves the roving tabindex to the visually-left dot and
196
+ `ArrowRight` to the visually-right one — previously both were index-based and moved the focus ring
197
+ against the direction the dots are actually drawn in. `ArrowUp`/`ArrowDown` are unchanged and never
198
+ flip (`direction` is a horizontal-axis property). The prev/next buttons are unchanged too — they
199
+ still step to the previous/next slide in both directions, and only their glyph flips. Also fixed:
200
+ two arrow presses faster than the dot nav's smooth scroll can settle now reliably advance two dots
201
+ instead of sometimes landing on the same one twice.
202
+
203
+ **Changed — `css`/`bricks`/`tailwind` (all formats).** `patterns/tree.css` gains a `.tree__summary`
204
+ row class (the enhanced-state replacement for `<summary>`), a hand-rolled expand/collapse animation
205
+ replacing the native `<details>` one that no longer applies post-upgrade, and a focus ring scoped to
206
+ the row rather than the whole item (the roving tabindex now lands on `.tree__item`, whose box wraps
207
+ its entire subtree once expanded). Visually equivalent to before; no consumer class rename needed.
208
+
209
+ **Added — `wc` (`@getvitops/core`, internal).** `web-components/utils/keynav.ts` (generic
210
+ key-decoding + type-ahead primitives) and `utils/tree-nav.ts` (tree-specific navigation decisions)
211
+ are new pure modules, and `utils/RovingTabindex.ts` is a new shared `ReactiveController` — modelled
212
+ on the existing `DragController` — that owns roving-tabindex bookkeeping for any keyboard-navigable
213
+ group. `<wc-carousel>`'s dot nav now runs on it too, and `<wc-gallery>` reuses `keynav.ts`'s
214
+ `stepIndex`. None of the three are in `@getvitops/core`'s public `exports` map. Only
215
+ `RovingTabindex` is re-exported from `web-components/index.ts`, the same way `DragController`
216
+ already is, not as new published API; `keynav.ts` and `tree-nav.ts` stay internal modules imported
217
+ directly by path (as `RovingTabindex.ts` and `gallery.ts` already do) since neither is consumed
218
+ outside the components that already import them directly.
219
+
220
+ **This changeset makes no consumer-facing change in `@getvitops/generator` beyond documentation
221
+ output.** `tiers.ts`'s `tree` entry gains `tree__summary` to its class list and describes the new
222
+ keyboard navigation and ARIA semantics — this changes what `vitops docs components` /
223
+ `concepts/components.md` render for the `tree` pattern, nothing else. `generator`'s real change in
224
+ this release is unrelated to `wc-tree` — see `localbusiness-schema.md`.
225
+
226
+ ### Minor Changes
227
+
228
+ - a6a8b39: `radii.pill` / `--br-pill` is gone. `999px` is a shape, not a design decision, so it no longer
229
+ has a config-editable token of its own — it's now the `rounded-full` utility, named and valued
230
+ to match Tailwind's own class, alongside a new `rounded-none`.
231
+
232
+ **Breaking — `css`/`bricks` only** (the tailwind format never emitted `--br-pill`; Tailwind
233
+ already ships `rounded-full`/`rounded-none` natively and always has). A consumer who overrode
234
+ `--br-pill` directly, or set `radii.pill` in their own `design-system.json` expecting it to
235
+ reshape the switch track, the facet-list count or the badge-indicator bubble, has to migrate:
236
+ - The switch track, facet count and badge indicator each already had their own consumer hook
237
+ (`--br-switch-track`, `--br-count`, `--br-badge-indicator`) and now fall back straight to the
238
+ literal `999px` instead of chaining through `--br-pill`. Override the specific hook instead of
239
+ the removed shared one.
240
+ - `.badge` is unaffected — it already resolved to `999px` and still does, now via its own
241
+ override (`patterns.items.badge.overrides.br`) rather than a shared primitive.
242
+ - Anything that wants a fully round corner outside those three patterns should reach for
243
+ `class="rounded-full"` (or `rounded-none` to zero one out) rather than a `--br-*` variable.
244
+
245
+ This is **not** reachable by `vitops lint --fix` — its token-rename table is built from colour
246
+ role names, and there is no equivalent static table for a shape primitive going away — so this
247
+ entry is the migration.
248
+
249
+ `radii.circle` / `--br-circle` (50%) is untouched: `status`, the radio and the switch thumb all
250
+ depend on it, and Tailwind has no equivalent to defer to.
251
+
252
+ - 7b391b3: Add `<wc-counter>` — animates a number from a start value to the value already in its fallback
253
+ text, on intersection. The stat/percentage figure in a media tile ("0 → 94%"), a KPI row, a
254
+ metrics band.
255
+
256
+ No consumer-facing change in this release outside `core`, `generator` and `astro` — `utils`,
257
+ `cli` and `vite` still ship in this release only because the six share one version.
258
+
259
+ **Added — `css`/`bricks`/`tailwind` (all formats):** `.counter` / `.counter__value` /
260
+ `.counter__presentation` (`patterns/counter.css`). A registered `--_n` custom property drives the
261
+ count via a plain CSS `@keyframes` animation — the interpolation and the easing curve are CSS's,
262
+ never duplicated in JS.
263
+
264
+ **Added — `wc` (`@getvitops/core`).** `<wc-counter>` parses the final value out of its own
265
+ `.counter__value` fallback text — never from a separate attribute, so the no-JS reading and the
266
+ animated reading can't disagree — and renders it back through `Intl.NumberFormat`, seeded from the
267
+ fallback text's own separators (a grouped `1,284` never animates through ungrouped intermediates).
268
+ `counter()` cannot do that part: no decimals, no locale grouping, which is the one thing here that
269
+ genuinely needs JavaScript.
270
+ - Triggers on intersection via a single shared `IntersectionObserver`, not on upgrade — a counter
271
+ below the fold that finished before the visitor scrolled to it would have done nothing.
272
+ - `prefers-reduced-motion: reduce` means don't animate at all, checked before the observer is even
273
+ created, with `patterns/counter.css`'s own reduced-motion query as a second belt.
274
+ - The accessible name stays the final value for the whole animation: `.counter__value` is toggled
275
+ to the framework's `.sr-only` utility while running, never hidden — `display: none`/`visibility:
276
+ hidden` would pull it out of the accessible-name computation along with the visual hiding, and a
277
+ screen reader must never be read ~60 intermediate numbers. The animated text lives in a separate
278
+ `aria-hidden` presentation span it never reaches.
279
+ - `data-from` (default `0`), `data-duration` (ms, default `1200`), `data-easing` (`linear` |
280
+ `ease-in` | `ease-out` | `float-sine` | `float-bounce` — maps onto the real
281
+ `--custom-ease-*`/`--ease-float-*` tokens, so a curve edited in `animation.css` cannot drift out
282
+ of step with this element), `data-decimals` (inferred from the fallback text when absent).
283
+ - Never leaves an intermediate value on screen as the resting state: disconnecting mid-animation
284
+ restores the fallback immediately, and it was never mutated in the first place — only the
285
+ presentation span was ever written to.
286
+
287
+ **Added — `astro`.** `<Counter value="94%" />` emits its own `<wc-counter>` — do NOT wrap it in
288
+ one, same rule as `Gallery`/`Carousel`/`Tree`. `value` is the only source of the final figure;
289
+ there is no separate `to` prop, for the same one-source-of-truth reason the element itself parses
290
+ its fallback rather than taking a duplicate attribute. `enhance={false}` emits the bare fallback
291
+ for a page that cannot run `elements.js`.
292
+
293
+ ### Patch Changes
294
+
295
+ - **Added — `utils`.** `itemListGraph()`, a pure schema.org `ItemList` JSON-LD builder — a sibling
296
+ of `breadcrumbGraph()`/`localBusinessGraph()`. Extracted from `@getvitops/astro`'s `<Carousel />`
297
+ so any consumer can build a valid `ItemList` (Google's "all-in-one page" carousel format:
298
+ `ListItem.item` carrying `@type`/`name`/`url`) for content that isn't one of the six Google
299
+ carousel rich-result types (`Article`/`Recipe`/`Movie`/`Course`/`Restaurant`/`Product`) — the
300
+ entity type is no longer constrained to that set.
301
+
302
+ **Changed — `astro`.** `<Carousel />`'s `CarouselItem['type']` now accepts any string, not just
303
+ the six carousel rich-result types — non-breaking, the union only widens. It's a thin wrapper
304
+ over `itemListGraph()` now; behaviour for existing callers is unchanged.
305
+
306
+ No consumer-facing change in this release outside `utils` and `astro` — `generator`, `cli` and
307
+ `vite` still ship in this release only because the six share one version.
308
+
309
+ **Fixed — `core` (`css`/`bricks`/`tailwind` build output, all formats).** The CSS and HTML
310
+ authored inside Lit's `css`/`html` tagged templates in `<wc-*>` component sources previously
311
+ survived JS minification verbatim — a JS minifier treats a template literal's cooked text as
312
+ opaque, so `elements.js` shipped ~690 lines of indented, unminified CSS (and the equivalent in
313
+ HTML) inside an otherwise-minified 886-line file. Two source-level build transforms now collapse
314
+ both before bundling: `postcss` + `postcss-lit` + `cssnano` for `css` templates, `minify-html-literals`
315
+ (`conservativeCollapse: true`, so whitespace between inline elements in light-DOM components never
316
+ collapses to zero) for `html` templates. `elements.js` drops from 886 lines / ~101 KB to 49 lines /
317
+ ~96 KB. A second build step deduplicates the 17 `@license` comment blocks (only 6 are textually
318
+ distinct) down to one verbatim copy of each — required by BSD-3/MIT/Apache-2.0's notice-retention
319
+ terms either way, just no longer repeated once per source file that carries it. No API change;
320
+ build-time only, and none of the added tooling (`postcss`, `postcss-lit`, `cssnano`,
321
+ `minify-html-literals`) is a runtime or published dependency.
322
+
323
+ - Updated dependencies [c0c092b]
324
+ - Updated dependencies
325
+ - Updated dependencies [2b50f9e]
326
+ - @getvitops/utils@7.0.0
327
+
3
328
  ## 6.0.0
4
329
 
5
330
  ### Major Changes
@@ -495,28 +820,20 @@
495
820
  {
496
821
  "designSystem": {
497
822
  "themes": {
498
- "default": {
499
- /* … */
500
- },
823
+ "default": {/* … */},
501
824
  },
502
825
  },
503
826
  "organization": {
504
827
  "name": "Acme",
505
828
  "contact": "hq",
506
829
  "locations": {
507
- "hq": {
508
- /* … */
509
- },
830
+ "hq": {/* … */},
510
831
  },
511
832
  },
512
833
  "site": {
513
834
  "defaultLocale": "en",
514
- "domains": {
515
- /* … */
516
- },
517
- "analytics": {
518
- /* … */
519
- },
835
+ "domains": {/* … */},
836
+ "analytics": {/* … */},
520
837
  },
521
838
  }
522
839
  ```
@@ -754,8 +1071,8 @@ open-fade-in"` composes slide and fade. Applied at zero specificity with identit
754
1071
 
755
1072
  ```js
756
1073
  vitops({
757
- analytics: { googleAnalytics: 'G-XXXXXXXXXX', plausible: 'acme.com' },
758
- consent: { policyUrl: '/legal/cookies' },
1074
+ analytics: { googleAnalytics: "G-XXXXXXXXXX", plausible: "acme.com" },
1075
+ consent: { policyUrl: "/legal/cookies" },
759
1076
  });
760
1077
  ```
761
1078
 
@@ -1379,7 +1696,7 @@ inset(0 100% 0 0)`, and `clip-path` clips **hit-testing** as well as painting
1379
1696
  ```js
1380
1697
  // astro.config.mjs
1381
1698
  getvitops({
1382
- css: { input: 'design-system.json', format: 'css', out: 'src/styles' },
1699
+ css: { input: "design-system.json", format: "css", out: "src/styles" },
1383
1700
  editor: true,
1384
1701
  });
1385
1702
  ```
package/css/animation.css CHANGED
@@ -71,6 +71,15 @@
71
71
  animation-duration: var(--animation-duration-xslow);
72
72
  }
73
73
 
74
+ /* The gallery/lightbox thumbnail → full-image morph (see patterns/lightbox.css)
75
+ needs a shorter duration than a whole-page navigation. Scoped to `*` because a
76
+ repo-wide `::view-transition-old/new` selector belongs at the engine layer, not
77
+ inside the one pattern partial that happens to use it first. */
78
+ ::view-transition-old(*),
79
+ ::view-transition-new(*) {
80
+ animation-duration: 0.3s;
81
+ }
82
+
74
83
  /* ===========================================
75
84
  * Keyframes - Layout Stage (most expensive)
76
85
  * =========================================== */
package/css/global.css CHANGED
@@ -75,3 +75,31 @@ body {
75
75
  scroll-padding-block-start: var(--top-offset, 0);
76
76
  }
77
77
  }
78
+
79
+ /* The focus ring must survive Windows High Contrast Mode, and as generated it
80
+ does not. Every pattern's `ring: true` state (`generate.ts`) emits `outline:
81
+ none; box-shadow: 0 0 0 3px <color>;` — a deliberate choice the rest of the
82
+ time, since a box-shadow ring can follow a border-radius where a native
83
+ outline cannot. But `forced-colors: active` forces `box-shadow` to `none`
84
+ unconditionally (CSS Color Adjust Module), and this framework already asked
85
+ for no native outline either — so a keyboard user in forced-colors mode gets
86
+ NO focus indicator at all, on every `:focus-visible` element in every
87
+ format. This is the single most severe instance of the class of bug
88
+ `forced-colors`/`prefers-contrast` coverage exists to catch (AGENTS.md's
89
+ design-system-gaps notes on `--surface-glass`/`--overlay`/role solids are
90
+ the same class, decorative rather than safety-critical).
91
+
92
+ `!important`, deliberately, for the same reason `:root`'s `font-size` above
93
+ gets it: this must win regardless of which pattern's `vitops.components`
94
+ rule set `outline: none`, and `!important` outranks a normal-priority
95
+ declaration regardless of cascade layer. The colour is the token every
96
+ other ring already uses (`--color-border-focus`, from `ui-primary`,
97
+ contrast-checked as a non-text boundary) — forced-colors mode remaps
98
+ `outline-color` to a system colour automatically, so this is really only
99
+ asserting THAT an outline renders, not which colour it renders in. */
100
+ @media (forced-colors: active) {
101
+ :focus-visible {
102
+ outline: 2px solid var(--color-border-focus) !important;
103
+ outline-offset: 2px !important;
104
+ }
105
+ }
package/css/index.css CHANGED
@@ -6,6 +6,7 @@
6
6
  @import './generated/type-tokens.css';
7
7
  @import './generated/tokens.css';
8
8
  @import './generated/typography.css';
9
+ @import './generated/typography-headings.css';
9
10
  @import './layout.css';
10
11
  /* Must precede utilities.css: both are `vitops.utilities`, and utilities.css
11
12
  re-emits `.<bp>-flex` AFTER its own `.hidden` so `class="hidden md-flex"`
@@ -43,6 +44,7 @@
43
44
  panel surface navshell's desktop block has to undo. */
44
45
  @import './patterns/navshell.css';
45
46
  @import './patterns/notification.css';
47
+ @import './patterns/gallery.css';
46
48
  @import './patterns/lightbox.css';
47
49
  @import './patterns/overlay.css';
48
50
  /* was forms.css */
@@ -52,6 +54,7 @@
52
54
  @import './patterns/table.css';
53
55
  @import './patterns/details.css';
54
56
  @import './patterns/comment.css';
57
+ @import './patterns/review.css';
55
58
  @import './patterns/banner.css';
56
59
  @import './patterns/consent.css';
57
60
  @import './patterns/list.css';
@@ -69,6 +72,7 @@
69
72
  @import './patterns/text-effects.css';
70
73
  @import './patterns/svg.css';
71
74
  @import './patterns/marquee.css';
75
+ @import './patterns/counter.css';
72
76
  @import './patterns/nav.css';
73
77
  @import './patterns/carousel.css';
74
78
  @import './patterns/copy.css';
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Counter — animates a number from a start value to the value already in its
3
+ * fallback text (`.counter__value`), e.g. the "0 → 94%" stat in a media tile.
4
+ * Consumes the generated token cascade (src/css/generated/tokens.css) only for
5
+ * `--custom-ease-out` (animation.css's engine layer).
6
+ *
7
+ * `<wc-counter>` owns the reading; this partial owns the interpolation. `--_n`
8
+ * is a registered custom property so the browser can smoothly animate it as a
9
+ * number — `counter()` cannot do decimals or locale grouping, so JS mirrors
10
+ * `--_n` into `.counter__presentation`'s text each frame via
11
+ * `Intl.NumberFormat`, formatted the same way the fallback text was. CSS still
12
+ * owns the interpolation, the easing curve and (as a second belt alongside the
13
+ * JS check) `prefers-reduced-motion`.
14
+ *
15
+ * `.counter__value` is toggled to the framework's `.sr-only` utility while
16
+ * running, not hidden — an element pulled out of the accessibility tree via
17
+ * `display: none`/`visibility: hidden` stops contributing to the accessible
18
+ * name, and that name must read the final value for the whole animation, not
19
+ * just at rest.
20
+ */
21
+ @property --_n {
22
+ syntax: '<number>';
23
+ initial-value: 0;
24
+ inherits: false;
25
+ }
26
+
27
+ .counter__presentation {
28
+ display: none;
29
+ }
30
+
31
+ wc-counter[running] .counter__presentation {
32
+ display: inline;
33
+ animation: counter-run var(--counter-duration, 1.2s) var(--counter-easing, var(--custom-ease-out))
34
+ forwards;
35
+ }
36
+
37
+ @keyframes counter-run {
38
+ from {
39
+ --_n: var(--counter-from, 0);
40
+ }
41
+ to {
42
+ --_n: var(--counter-to);
43
+ }
44
+ }
45
+
46
+ @media (prefers-reduced-motion: reduce) {
47
+ wc-counter[running] .counter__presentation {
48
+ animation: none;
49
+ }
50
+ }
@@ -287,7 +287,7 @@ input[type='color'] {
287
287
  position: relative;
288
288
  inline-size: var(--_switch-width);
289
289
  block-size: var(--_switch-height);
290
- border-radius: var(--br-switch-track, var(--br-pill, 999px));
290
+ border-radius: var(--br-switch-track, 999px);
291
291
  background: var(--color-bg-surface-muted);
292
292
  transition: background-color 0.2s ease;
293
293
  }
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Gallery — thumbnail grid whose triggers open a `.lightbox-dialog` (patterns/lightbox.css).
3
+ * Consumes the generated token cascade (src/css/generated/tokens.css).
4
+ *
5
+ * Split out of what used to be `.lightbox`'s grid half. The two are separate
6
+ * concerns — "a grid of images" and "view one full-screen" — and only the dialog
7
+ * half needs the `lightbox` name; the grid never was one.
8
+ *
9
+ * `<wc-gallery>` wraps this and the single `.lightbox-dialog` it opens, running the
10
+ * thumbnail → full-image view-transition morph; stepping between images is a
11
+ * `<wc-carousel>` scroll inside that dialog, not a second dialog. With no JS each
12
+ * `.gallery__trigger` is a real `<a href="#slide-id">` into the carousel's own
13
+ * `<li id="slide-id">`, and `:has(:target)` in lightbox.css is what reveals the
14
+ * dialog — so the grid + dialog already form a working modal lightbox, with
15
+ * prev/next, before any script runs.
16
+ */
17
+
18
+ wc-gallery {
19
+ /* Unregistered custom elements default to `display: inline`, which forms an
20
+ inline box around this grid's block content until `elements.js` upgrades it. */
21
+ display: block;
22
+ }
23
+
24
+ .gallery {
25
+ --_br: var(--br-gallery, var(--br-gallery-group, var(--br-default)));
26
+
27
+ display: grid;
28
+ grid-template-columns: repeat(auto-fill, minmax(var(--gallery-thumb-size, 150px), 1fr));
29
+ gap: var(--gallery-gap, 0.5rem);
30
+ }
31
+
32
+ .gallery__item {
33
+ aspect-ratio: var(--gallery-aspect, 1);
34
+ overflow: hidden;
35
+ border-radius: var(--_br);
36
+ }
37
+
38
+ .gallery__trigger {
39
+ display: block;
40
+ inline-size: 100%;
41
+ block-size: 100%;
42
+ margin: 0;
43
+ padding: 0;
44
+ background: none;
45
+ border: none;
46
+ text-decoration: none;
47
+ cursor: pointer;
48
+
49
+ &:focus-visible {
50
+ outline: 2px solid var(--gallery-focus-color, currentColor);
51
+ outline-offset: 2px;
52
+ }
53
+ }
54
+
55
+ .gallery__thumb {
56
+ inline-size: 100%;
57
+ block-size: 100%;
58
+ object-fit: cover;
59
+ transition: scale 0.3s ease;
60
+ }
61
+
62
+ .gallery__trigger:hover .gallery__thumb {
63
+ scale: 1.05;
64
+ }