@tjakoen/grain 0.1.25 → 0.1.27

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.
@@ -207,3 +207,13 @@ body[data-viewport="mobile"] { --shell-viewport-w: 24.4rem; }
207
207
  ::view-transition-old(shell-rail), ::view-transition-old(shell-topbar),
208
208
  ::view-transition-old(shell-aside), ::view-transition-old(shell-console),
209
209
  ::view-transition-old(shell-window), ::view-transition-old(shell-status) { display: none; }
210
+ /* <main> gets its own transition rather than riding the root cross-fade: the old page leaves fast,
211
+ and the new one fades in with a 4px rise, so a tab switch reads as a page settling into place
212
+ rather than two pages blinking through each other. Short on purpose; the chrome around it holds
213
+ still, so this is the only motion on screen. Reduced motion turns it off with the rest. */
214
+ .app-shell__main { view-transition-name: shell-main; }
215
+ ::view-transition-group(shell-main) { animation: none; }
216
+ ::view-transition-old(shell-main) { animation: 90ms ease-out both shell-main-out; }
217
+ ::view-transition-new(shell-main) { animation: 200ms cubic-bezier(0.2, 0, 0, 1) 40ms both shell-main-in; }
218
+ @keyframes shell-main-out { to { opacity: 0; } }
219
+ @keyframes shell-main-in { from { opacity: 0; transform: translateY(4px); } }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tjakoen/grain",
3
- "version": "0.1.25",
3
+ "version": "0.1.27",
4
4
  "description": "GRAIN — an AI-interaction design system where every surface is operable by both a human and an AI through one shared vocabulary.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
package/scripts/tabs.js CHANGED
@@ -123,5 +123,9 @@
123
123
  // refresh: re-resolve labels (e.g. after an island fills the data-tab-source tree lazily)
124
124
  window.grain.tabs = { open: () => [...list], close: closeTab, closeAll, refresh: render };
125
125
  }
126
- if (document.readyState === "loading") document.addEventListener("DOMContentLoaded", init); else init();
126
+ // Loaded as a classic script right after the strip, it renders before the first paint, which a
127
+ // view transition captures; that keeps the stored tabs from popping in a frame late. Loaded any
128
+ // later (defer, module, end of body), the strip is parsed and this simply runs.
129
+ if (document.readyState !== "loading" || document.querySelector("[data-open-tabs]")) init();
130
+ else document.addEventListener("DOMContentLoaded", init);
127
131
  })();