@photon-ai/pho-ui 2.15.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.
- package/dist/chunks/{basic-page-CVZT_zaH.js → basic-page-CMJuM5iA.js} +631 -592
- package/dist/chunks/basic-page-CMJuM5iA.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/sections/basic-page.js +1 -1
- package/dist/src/sections/basic-page/basic-page.d.ts +44 -22
- package/package.json +1 -1
- package/dist/chunks/basic-page-CVZT_zaH.js.map +0 -1
|
@@ -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
|
|
130
|
-
* in from 8px
|
|
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
|
/**
|
|
@@ -159,9 +175,9 @@ export interface BasicPageTitleProps extends ComponentProps<"h1"> {
|
|
|
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
177
|
* from the back link when returned to from its own subpage. Played once
|
|
162
|
-
* per visit: a title taking over from a loading
|
|
163
|
-
* (its skeleton's, or
|
|
164
|
-
* under reduced motion.
|
|
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.
|
|
165
181
|
*/
|
|
166
182
|
enter?: boolean;
|
|
167
183
|
/**
|
|
@@ -187,12 +203,15 @@ declare function Title({ id, morphId, enter: enterProp, trailing, className, chi
|
|
|
187
203
|
export interface BasicPageStackProps extends Omit<ComponentProps<"div">, RevealMotionConflicts> {
|
|
188
204
|
/**
|
|
189
205
|
* Whether mounting plays the page entrance. Left unset, the stack decides
|
|
190
|
-
* from what is on screen: it enters unless
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
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.
|
|
196
215
|
*/
|
|
197
216
|
enter?: boolean;
|
|
198
217
|
ref?: Ref<HTMLDivElement>;
|
|
@@ -210,16 +229,19 @@ export interface BasicPageStackProps extends Omit<ComponentProps<"div">, RevealM
|
|
|
210
229
|
* - **Entering the page** — whatever the page first shows (skeleton
|
|
211
230
|
* included) rides in with its stack.
|
|
212
231
|
* - **Skeleton, then the data** — a skeleton is a stack under `aria-busy`
|
|
213
|
-
* (its own, or a wrapper's). The loaded stack mounting in its place
|
|
214
|
-
* finds it
|
|
215
|
-
* the values fill in. Whether the skeleton is a separate
|
|
216
|
-
* (swapped for the loaded return) or one stack branching its
|
|
217
|
-
* (`{pending ? bones : content}`) makes no difference to the
|
|
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.
|
|
218
239
|
* - **Skeleton that is already on screen before React** (rendered to a
|
|
219
240
|
* string, painted before the bundle, re-rendered as-is on React's first
|
|
220
|
-
* commit) — static markup never enters,
|
|
221
|
-
*
|
|
222
|
-
*
|
|
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.
|
|
223
245
|
* - **A region the skeleton couldn't predict** (a list of unknown length)
|
|
224
246
|
* — `Reveal` rises that region in once its shape is known.
|
|
225
247
|
*
|
|
@@ -236,8 +258,8 @@ export interface BasicPageHeaderProps extends Omit<ComponentProps<"div">, Reveal
|
|
|
236
258
|
* `enter`, for a subpage title that carries a description: the pair
|
|
237
259
|
* floats up from below the departing morph word as one block. Put `enter`
|
|
238
260
|
* here and NOT on the `Title` inside. As for `Title`, stays put when it
|
|
239
|
-
* takes over from a loading page
|
|
240
|
-
* reduced motion.
|
|
261
|
+
* takes over from a loading part in this page's `Root`, or from a
|
|
262
|
+
* prerendered page anywhere. Skipped under reduced motion.
|
|
241
263
|
*/
|
|
242
264
|
enter?: boolean;
|
|
243
265
|
ref?: Ref<HTMLDivElement>;
|