@photon-ai/pho-ui 2.14.0 → 2.16.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.
@@ -82,8 +82,19 @@ export interface BasicPageRootProps extends ComponentProps<"div"> {
82
82
  * space is margin, not content width.
83
83
  */
84
84
  width?: "base" | "wide";
85
+ /**
86
+ * This page was painted before React — rendered to a string and inlined
87
+ * ahead of the bundle (a boot skeleton), or the React twin re-rendering
88
+ * that markup as-is on its first commit. Marks the root with
89
+ * `data-basic-page-prerendered`. Nothing inside it plays the entrance,
90
+ * an explicit `enter` included: the page is already on screen, and
91
+ * starting values would blink it out. The React page taking over from
92
+ * it stays put too — it finds the marker in the document at its first
93
+ * render, while the twin is still there.
94
+ */
95
+ prerendered?: boolean;
85
96
  }
86
- declare function Root({ condense, width, className, children, ref, ...props }: BasicPageRootProps): import("react").JSX.Element;
97
+ declare function Root({ condense, width, prerendered, className, children, ref, ...props }: BasicPageRootProps): import("react").JSX.Element;
87
98
  /**
88
99
  * Condensing header — the page's way back once the title has scrolled away.
89
100
  * `Root condense` renders a sticky bar in the reserved top zone; `Title` and
@@ -126,8 +137,9 @@ declare function CondenseScope({ adopt, children, }: {
126
137
  export declare function useCondense(): BasicPageCondense;
127
138
  /**
128
139
  * The condensed bar's motion, exported for a shell that adopts the bar
129
- * (`CondenseScope`) so its swap moves the same way: 0.2s ease-out, dropping
130
- * in from 8px above and leaving the same way.
140
+ * (`CondenseScope`) so its swap moves the same way: 0.2s ease-out. The bar
141
+ * fades in place; its page name rises in from 8px below and leaves the
142
+ * same way.
131
143
  */
132
144
  export declare const CONDENSE_BAR_ENTER: {
133
145
  readonly duration: 0.2;
@@ -143,6 +155,10 @@ export declare const CONDENSE_BAR_TRAVEL: {
143
155
  readonly duration: 0.2;
144
156
  readonly ease: "linear";
145
157
  };
158
+ /**
159
+ * The bar's rise distance, signed as "from above": the page name comes
160
+ * from below, so it starts at `-CONDENSE_BAR_RISE_PX`.
161
+ */
146
162
  export declare const CONDENSE_BAR_RISE_PX = -8;
147
163
  export interface BasicPageTitleProps extends ComponentProps<"h1"> {
148
164
  /**
@@ -158,8 +174,10 @@ export interface BasicPageTitleProps extends ComponentProps<"h1"> {
158
174
  * the two form one upward stream and never overlap. Combines with
159
175
  * `morphId` for a mid-level page (a list that is itself a subpage): the
160
176
  * word rises in when the page is entered from its parent and flies in
161
- * from the back link when returned to from its own subpage. Skipped
162
- * under reduced motion.
177
+ * from the back link when returned to from its own subpage. Played once
178
+ * per visit: a title taking over from a loading part in this page's
179
+ * `Root` (its skeleton's), or from a prerendered page anywhere (the one
180
+ * painted before React), stays put. Skipped under reduced motion.
163
181
  */
164
182
  enter?: boolean;
165
183
  /**
@@ -181,15 +199,19 @@ export interface BasicPageTitleProps extends ComponentProps<"h1"> {
181
199
  * `shrink-0` siblings of a `min-w-0 truncate` label inside a `flex min-w-0`
182
200
  * row so they stay visible.
183
201
  */
184
- declare function Title({ id, morphId, enter, trailing, className, children, ...props }: BasicPageTitleProps): import("react").JSX.Element;
202
+ declare function Title({ id, morphId, enter: enterProp, trailing, className, children, ...props }: BasicPageTitleProps): import("react").JSX.Element;
185
203
  export interface BasicPageStackProps extends Omit<ComponentProps<"div">, RevealMotionConflicts> {
186
204
  /**
187
- * Play the page entrance on mount (the default). `false` renders the
188
- * stack at rest, for a loading state that is already on screen — painted
189
- * as static HTML before the bundle, re-rendered as-is on React's first
190
- * commit, then shown by the page until its data arrives — so that none of
191
- * those mounts moves it; the real stack, with its entrance, takes over
192
- * with the data.
205
+ * Whether mounting plays the page entrance. Left unset, the stack decides
206
+ * from what is on screen: it enters unless it is taking over from a
207
+ * loading part in this page's `Root` — a stack marked `aria-busy`, or
208
+ * inside an `aria-busy` region — or a prerendered page is anywhere in
209
+ * the document. In the first case the skeleton was the page's entrance
210
+ * and this stack takes its place at rest, values filling in; in the
211
+ * second the page was painted before React and is already there. A
212
+ * loading part in some other page (one still on screen while this one
213
+ * mounts) does not count. `true` always enters, except inside a
214
+ * `Root prerendered`; `false` never does.
193
215
  */
194
216
  enter?: boolean;
195
217
  ref?: Ref<HTMLDivElement>;
@@ -199,21 +221,29 @@ export interface BasicPageStackProps extends Omit<ComponentProps<"div">, RevealM
199
221
  * each block lays out its children with `gap-3`.
200
222
  *
201
223
  * Mounting plays the page entrance: the stack rises 12px and fades in on the
202
- * Card-shell / Command spring while `Title` / `Back` above stay put. What
224
+ * Card-shell / Command spring while `Title` / `Back` above stay put. The
225
+ * entrance is the page's, played once per visit by whatever the page first
226
+ * shows; a stack that takes over from a loading one appears at rest. What
203
227
  * that means per state:
204
228
  *
205
229
  * - **Entering the page** — whatever the page first shows (skeleton
206
230
  * included) rides in with its stack.
207
- * - **Skeleton in a separate component** — swapping it for the loaded
208
- * return mounts a fresh stack, so the entrance replays as the
209
- * data-arrival animation. That's the right feel for shapes the skeleton
210
- * couldn't predict (lists of unknown length).
211
- * - **1:1 skeleton** — keep ONE stack mounted and branch its children
212
- * (`{pending ? bones : content}`): values then fill in place with no
213
- * motion.
214
- * - **Skeleton that is already on screen** (server-painted, then hydrated,
215
- * then shown by the page) — `enter={false}`: the stack renders at rest and
216
- * the entrance is the loaded stack's alone.
231
+ * - **Skeleton, then the data** — a skeleton is a stack under `aria-busy`
232
+ * (its own, or a wrapper's). The loaded stack mounting in its place, in
233
+ * the same `Root`, finds it there and renders at rest: the shape was
234
+ * already there, the values fill in. Whether the skeleton is a separate
235
+ * component (swapped for the loaded return) or one stack branching its
236
+ * children (`{pending ? bones : content}`) makes no difference to the
237
+ * motion. Only this page's `Root` counts: a skeleton still on screen in
238
+ * the page being left does not hold the next page at rest.
239
+ * - **Skeleton that is already on screen before React** (rendered to a
240
+ * string, painted before the bundle, re-rendered as-is on React's first
241
+ * commit) — its `Root` says `prerendered`: static markup never enters,
242
+ * nothing inside that root does either, and the React page taking over
243
+ * finds the marker in the document and stays put on its own;
244
+ * `enter={false}` says so outright for markup that must never move.
245
+ * - **A region the skeleton couldn't predict** (a list of unknown length)
246
+ * — `Reveal` rises that region in once its shape is known.
217
247
  *
218
248
  * Static under reduced motion.
219
249
  */
@@ -227,12 +257,14 @@ export interface BasicPageHeaderProps extends Omit<ComponentProps<"div">, Reveal
227
257
  * Rise this header into place on mount — the Header flavor of `Title`'s
228
258
  * `enter`, for a subpage title that carries a description: the pair
229
259
  * floats up from below the departing morph word as one block. Put `enter`
230
- * here and NOT on the `Title` inside. Skipped under reduced motion.
260
+ * here and NOT on the `Title` inside. As for `Title`, stays put when it
261
+ * takes over from a loading part in this page's `Root`, or from a
262
+ * prerendered page anywhere. Skipped under reduced motion.
231
263
  */
232
264
  enter?: boolean;
233
265
  ref?: Ref<HTMLDivElement>;
234
266
  }
235
- declare function Header({ enter, className, ...props }: BasicPageHeaderProps): import("react").JSX.Element;
267
+ declare function Header({ enter: enterProp, className, ...props }: BasicPageHeaderProps): import("react").JSX.Element;
236
268
  /**
237
269
  * An action at the header row's end — a small button (or two) seated in
238
270
  * the `Header` grid the way `Search` is: top-right of the block, its top
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@photon-ai/pho-ui",
3
- "version": "2.14.0",
3
+ "version": "2.16.0",
4
4
  "description": "Pho Design System — Photon's React component library, built on Base UI",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {