@photon-ai/pho-ui 2.13.0 → 2.15.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/IconChevronRight-CzoJnYNI.js +11 -0
- package/dist/chunks/IconChevronRight-CzoJnYNI.js.map +1 -0
- package/dist/chunks/{basic-page-CJwG4I83.js → basic-page-CVZT_zaH.js} +619 -614
- package/dist/chunks/basic-page-CVZT_zaH.js.map +1 -0
- package/dist/chunks/code-block-CdozzaHM.js +139 -0
- package/dist/chunks/code-block-CdozzaHM.js.map +1 -0
- package/dist/chunks/combobox-D4LiGJB2.js +136 -0
- package/dist/chunks/combobox-D4LiGJB2.js.map +1 -0
- package/dist/chunks/command-Ck8IAgV7.js +192 -0
- package/dist/chunks/command-Ck8IAgV7.js.map +1 -0
- package/dist/chunks/copy-button-B_B15mEi.js +56 -0
- package/dist/chunks/copy-button-B_B15mEi.js.map +1 -0
- package/dist/chunks/description-list-C-mwe4ki.js +59 -0
- package/dist/chunks/description-list-C-mwe4ki.js.map +1 -0
- package/dist/chunks/filter-bar-Cjjq38xo.js +259 -0
- package/dist/chunks/filter-bar-Cjjq38xo.js.map +1 -0
- package/dist/chunks/log-list-0AXnjFrk.js +244 -0
- package/dist/chunks/log-list-0AXnjFrk.js.map +1 -0
- package/dist/chunks/toggle-o84tawXy.js +33 -0
- package/dist/chunks/toggle-o84tawXy.js.map +1 -0
- package/dist/chunks/tooltip-BTF7GChl.js +32 -0
- package/dist/chunks/tooltip-BTF7GChl.js.map +1 -0
- package/dist/chunks/trace-CbH0IohX.js +314 -0
- package/dist/chunks/trace-CbH0IohX.js.map +1 -0
- package/dist/chunks/use-copy-D6JwKUll.js +25 -0
- package/dist/chunks/use-copy-D6JwKUll.js.map +1 -0
- package/dist/components/code-block.js +6 -0
- package/dist/components/combobox.js +1 -1
- package/dist/components/command.js +3 -189
- package/dist/components/copy-button.js +6 -0
- package/dist/components/description-list.js +5 -0
- package/dist/components/filter-bar.js +8 -0
- package/dist/components/log-list.js +8 -0
- package/dist/components/phone-input.js +1 -1
- package/dist/components/toggle.js +3 -30
- package/dist/components/tooltip.js +2 -29
- package/dist/components/trace.js +9 -0
- package/dist/index.js +122 -96
- package/dist/primitives.js +2 -2
- package/dist/sections/basic-page.js +17 -17
- package/dist/src/components/accordion/index.d.ts +1 -1
- package/dist/src/components/code-block/code-block.d.ts +43 -0
- package/dist/src/components/code-block/index.d.ts +2 -0
- package/dist/src/components/code-block/tokenize-json.d.ts +12 -0
- package/dist/src/components/combobox/combobox.d.ts +30 -4
- package/dist/src/components/combobox/index.d.ts +1 -1
- package/dist/src/components/copy-button/copy-button.d.ts +49 -0
- package/dist/src/components/copy-button/index.d.ts +1 -0
- package/dist/src/components/description-list/description-list.d.ts +60 -0
- package/dist/src/components/description-list/index.d.ts +1 -0
- package/dist/src/components/filter-bar/filter-bar.d.ts +101 -0
- package/dist/src/components/filter-bar/index.d.ts +1 -0
- package/dist/src/components/log-list/index.d.ts +1 -0
- package/dist/src/components/log-list/log-list.d.ts +136 -0
- package/dist/src/components/trace/index.d.ts +2 -0
- package/dist/src/components/trace/layout.d.ts +48 -0
- package/dist/src/components/trace/trace.d.ts +53 -0
- package/dist/src/index.d.ts +6 -0
- package/dist/src/sections/basic-page/basic-page.d.ts +34 -24
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/use-copy.d.ts +14 -0
- package/dist/utils.js +6 -3
- package/package.json +25 -1
- package/src/styles/theme.css +30 -0
- package/dist/chunks/basic-page-CJwG4I83.js.map +0 -1
- package/dist/chunks/combobox-Dj5m_dDd.js +0 -117
- package/dist/chunks/combobox-Dj5m_dDd.js.map +0 -1
- package/dist/components/command.js.map +0 -1
- package/dist/components/toggle.js.map +0 -1
- package/dist/components/tooltip.js.map +0 -1
|
@@ -158,7 +158,9 @@ export interface BasicPageTitleProps extends ComponentProps<"h1"> {
|
|
|
158
158
|
* the two form one upward stream and never overlap. Combines with
|
|
159
159
|
* `morphId` for a mid-level page (a list that is itself a subpage): the
|
|
160
160
|
* 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.
|
|
161
|
+
* from the back link when returned to from its own subpage. Played once
|
|
162
|
+
* per visit: a title taking over from a loading page already on screen
|
|
163
|
+
* (its skeleton's, or the one painted before React) stays put. Skipped
|
|
162
164
|
* under reduced motion.
|
|
163
165
|
*/
|
|
164
166
|
enter?: boolean;
|
|
@@ -181,15 +183,16 @@ export interface BasicPageTitleProps extends ComponentProps<"h1"> {
|
|
|
181
183
|
* `shrink-0` siblings of a `min-w-0 truncate` label inside a `flex min-w-0`
|
|
182
184
|
* row so they stay visible.
|
|
183
185
|
*/
|
|
184
|
-
declare function Title({ id, morphId, enter, trailing, className, children, ...props }: BasicPageTitleProps): import("react").JSX.Element;
|
|
186
|
+
declare function Title({ id, morphId, enter: enterProp, trailing, className, children, ...props }: BasicPageTitleProps): import("react").JSX.Element;
|
|
185
187
|
export interface BasicPageStackProps extends Omit<ComponentProps<"div">, RevealMotionConflicts> {
|
|
186
188
|
/**
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
189
|
+
* Whether mounting plays the page entrance. Left unset, the stack decides
|
|
190
|
+
* from what is on screen: it enters unless a loading stack — one marked
|
|
191
|
+
* `aria-busy`, or inside an `aria-busy` region — is already there, in
|
|
192
|
+
* which case the skeleton was the page's entrance and this stack takes
|
|
193
|
+
* its place at rest, values filling in. `true` always enters; `false`
|
|
194
|
+
* never does (static markup React re-renders as-is on its first commit
|
|
195
|
+
* has nothing to arrive from).
|
|
193
196
|
*/
|
|
194
197
|
enter?: boolean;
|
|
195
198
|
ref?: Ref<HTMLDivElement>;
|
|
@@ -199,21 +202,26 @@ export interface BasicPageStackProps extends Omit<ComponentProps<"div">, RevealM
|
|
|
199
202
|
* each block lays out its children with `gap-3`.
|
|
200
203
|
*
|
|
201
204
|
* 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.
|
|
205
|
+
* Card-shell / Command spring while `Title` / `Back` above stay put. The
|
|
206
|
+
* entrance is the page's, played once per visit by whatever the page first
|
|
207
|
+
* shows; a stack that takes over from a loading one appears at rest. What
|
|
203
208
|
* that means per state:
|
|
204
209
|
*
|
|
205
210
|
* - **Entering the page** — whatever the page first shows (skeleton
|
|
206
211
|
* included) rides in with its stack.
|
|
207
|
-
* - **Skeleton
|
|
208
|
-
*
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
* (`{pending ? bones : content}`)
|
|
213
|
-
*
|
|
214
|
-
*
|
|
215
|
-
*
|
|
216
|
-
* the
|
|
212
|
+
* - **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 on screen and renders at rest: the shape was already there,
|
|
215
|
+
* the values fill in. Whether the skeleton is a separate component
|
|
216
|
+
* (swapped for the loaded return) or one stack branching its children
|
|
217
|
+
* (`{pending ? bones : content}`) makes no difference to the motion.
|
|
218
|
+
* - **Skeleton that is already on screen before React** (rendered to a
|
|
219
|
+
* string, painted before the bundle, re-rendered as-is on React's first
|
|
220
|
+
* commit) — static markup never enters, and the twin finds the static
|
|
221
|
+
* one in the document and stays put on its own; `enter={false}` says so
|
|
222
|
+
* outright for markup that must never move.
|
|
223
|
+
* - **A region the skeleton couldn't predict** (a list of unknown length)
|
|
224
|
+
* — `Reveal` rises that region in once its shape is known.
|
|
217
225
|
*
|
|
218
226
|
* Static under reduced motion.
|
|
219
227
|
*/
|
|
@@ -227,18 +235,20 @@ export interface BasicPageHeaderProps extends Omit<ComponentProps<"div">, Reveal
|
|
|
227
235
|
* Rise this header into place on mount — the Header flavor of `Title`'s
|
|
228
236
|
* `enter`, for a subpage title that carries a description: the pair
|
|
229
237
|
* floats up from below the departing morph word as one block. Put `enter`
|
|
230
|
-
* here and NOT on the `Title` inside.
|
|
238
|
+
* here and NOT on the `Title` inside. As for `Title`, stays put when it
|
|
239
|
+
* takes over from a loading page already on screen. Skipped under
|
|
240
|
+
* reduced motion.
|
|
231
241
|
*/
|
|
232
242
|
enter?: boolean;
|
|
233
243
|
ref?: Ref<HTMLDivElement>;
|
|
234
244
|
}
|
|
235
|
-
declare function Header({ enter, className, ...props }: BasicPageHeaderProps): import("react").JSX.Element;
|
|
245
|
+
declare function Header({ enter: enterProp, className, ...props }: BasicPageHeaderProps): import("react").JSX.Element;
|
|
236
246
|
/**
|
|
237
247
|
* An action at the header row's end — a small button (or two) seated in
|
|
238
248
|
* the `Header` grid the way `Search` is: top-right of the block, its top
|
|
239
|
-
* edge on the
|
|
240
|
-
* `Header` after the text; with
|
|
241
|
-
* search's right.
|
|
249
|
+
* edge on the header's top, flush with the card edge below; text shorter
|
|
250
|
+
* than it centers against it. Put it inside `Header` after the text; with
|
|
251
|
+
* a `Search` present it stands to the search's right.
|
|
242
252
|
*/
|
|
243
253
|
declare function HeaderAction({ className, ...props }: ComponentProps<"div"> & {
|
|
244
254
|
ref?: Ref<HTMLDivElement>;
|
|
@@ -3,3 +3,4 @@ export { isReactComponent } from './is-react-component';
|
|
|
3
3
|
export { resolveVariant, type VariantDef, type VariantMap, } from './resolve-variant';
|
|
4
4
|
export { LinkProvider, useLinkComponent, type LinkComponent, } from './link-provider';
|
|
5
5
|
export { usePressPulse, CONTROL_PRESS_SCALE, CONTROL_PRESS_SPRING, } from './use-press-pulse';
|
|
6
|
+
export { useCopy, COPY_FEEDBACK_MS } from './use-copy';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** How long a copy control reads "Copied" before it settles back. */
|
|
2
|
+
export declare const COPY_FEEDBACK_MS = 1500;
|
|
3
|
+
/**
|
|
4
|
+
* Copy text to the clipboard and remember, briefly, that it happened —
|
|
5
|
+
* the state behind every copy affordance in Pho (the id in a log row,
|
|
6
|
+
* the value in a description list, a code panel's button). `copy`
|
|
7
|
+
* resolves to whether the write landed; `copied` holds for
|
|
8
|
+
* `COPY_FEEDBACK_MS` so the control can swap its glyph and its live
|
|
9
|
+
* region can announce. SSR-safe: the clipboard is only touched on call.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useCopy(resetMs?: number): {
|
|
12
|
+
copied: boolean;
|
|
13
|
+
copy: (text: string) => Promise<boolean>;
|
|
14
|
+
};
|
package/dist/utils.js
CHANGED
|
@@ -3,14 +3,17 @@ import { t as r } from "./chunks/cn-ChIgwEl3.js";
|
|
|
3
3
|
import { t } from "./chunks/is-react-component-DSnjtBmo.js";
|
|
4
4
|
import { t as m } from "./chunks/resolve-variant-CcD8iG5l.js";
|
|
5
5
|
import { n as i, t as n } from "./chunks/link-provider-DXzDQ08N.js";
|
|
6
|
-
import { n as
|
|
6
|
+
import { n as C, r as P, t as S } from "./chunks/use-press-pulse-IbNstUT0.js";
|
|
7
|
+
import { n as R, t as _ } from "./chunks/use-copy-D6JwKUll.js";
|
|
7
8
|
export {
|
|
8
9
|
S as CONTROL_PRESS_SCALE,
|
|
9
|
-
|
|
10
|
+
C as CONTROL_PRESS_SPRING,
|
|
11
|
+
_ as COPY_FEEDBACK_MS,
|
|
10
12
|
n as LinkProvider,
|
|
11
13
|
r as cn,
|
|
12
14
|
t as isReactComponent,
|
|
13
15
|
m as resolveVariant,
|
|
16
|
+
R as useCopy,
|
|
14
17
|
i as useLinkComponent,
|
|
15
|
-
|
|
18
|
+
P as usePressPulse
|
|
16
19
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@photon-ai/pho-ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.15.0",
|
|
4
4
|
"description": "Pho Design System — Photon's React component library, built on Base UI",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|
|
@@ -423,6 +423,30 @@
|
|
|
423
423
|
"./components/line-chart": {
|
|
424
424
|
"types": "./dist/src/components/line-chart/index.d.ts",
|
|
425
425
|
"import": "./dist/components/line-chart.js"
|
|
426
|
+
},
|
|
427
|
+
"./components/copy-button": {
|
|
428
|
+
"types": "./dist/src/components/copy-button/index.d.ts",
|
|
429
|
+
"import": "./dist/components/copy-button.js"
|
|
430
|
+
},
|
|
431
|
+
"./components/filter-bar": {
|
|
432
|
+
"types": "./dist/src/components/filter-bar/index.d.ts",
|
|
433
|
+
"import": "./dist/components/filter-bar.js"
|
|
434
|
+
},
|
|
435
|
+
"./components/log-list": {
|
|
436
|
+
"types": "./dist/src/components/log-list/index.d.ts",
|
|
437
|
+
"import": "./dist/components/log-list.js"
|
|
438
|
+
},
|
|
439
|
+
"./components/description-list": {
|
|
440
|
+
"types": "./dist/src/components/description-list/index.d.ts",
|
|
441
|
+
"import": "./dist/components/description-list.js"
|
|
442
|
+
},
|
|
443
|
+
"./components/code-block": {
|
|
444
|
+
"types": "./dist/src/components/code-block/index.d.ts",
|
|
445
|
+
"import": "./dist/components/code-block.js"
|
|
446
|
+
},
|
|
447
|
+
"./components/trace": {
|
|
448
|
+
"types": "./dist/src/components/trace/index.d.ts",
|
|
449
|
+
"import": "./dist/components/trace.js"
|
|
426
450
|
}
|
|
427
451
|
},
|
|
428
452
|
"peerDependencies": {
|
package/src/styles/theme.css
CHANGED
|
@@ -487,4 +487,34 @@
|
|
|
487
487
|
opacity: 0;
|
|
488
488
|
}
|
|
489
489
|
}
|
|
490
|
+
|
|
491
|
+
/* ============================ Code (logs) ============================ */
|
|
492
|
+
/* logs: the read-only code panel (CodeBlock) and its JSON tokens. The
|
|
493
|
+
surface is a well one step off the card: the page gray in light, a
|
|
494
|
+
step below the card in dark. Syntax inks come from the accent set
|
|
495
|
+
above, darkened for white and lifted (and softened) for dark so a
|
|
496
|
+
body reads at the mono size in both. `--color-*` so text-, bg-, and
|
|
497
|
+
border- utilities all exist. */
|
|
498
|
+
--color-pho-code-bg: light-dark(oklch(0.985 0 0), oklch(0.13 0 0));
|
|
499
|
+
--color-pho-code-fg: light-dark(oklch(0 0 0 / 0.85), oklch(1 0 0 / 0.85));
|
|
500
|
+
--color-pho-code-key: light-dark(
|
|
501
|
+
oklch(0.499 0.142 263.2),
|
|
502
|
+
oklch(0.74 0.11 263.2)
|
|
503
|
+
);
|
|
504
|
+
--color-pho-code-string: light-dark(
|
|
505
|
+
oklch(0.52 0.13 149.2),
|
|
506
|
+
oklch(0.78 0.13 149.2)
|
|
507
|
+
);
|
|
508
|
+
--color-pho-code-number: light-dark(
|
|
509
|
+
oklch(0.58 0.15 57.8),
|
|
510
|
+
oklch(0.8 0.13 71.4)
|
|
511
|
+
);
|
|
512
|
+
--color-pho-code-keyword: light-dark(
|
|
513
|
+
oklch(0.55 0.19 307.5),
|
|
514
|
+
oklch(0.78 0.15 307.5)
|
|
515
|
+
);
|
|
516
|
+
--color-pho-code-punctuation: light-dark(
|
|
517
|
+
oklch(0 0 0 / 0.55),
|
|
518
|
+
oklch(1 0 0 / 0.55)
|
|
519
|
+
);
|
|
490
520
|
}
|