@photon-ai/pho-ui 1.5.0 → 2.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/dist/chunks/IconAlertCircleFilled-VxKU8TYK.js +11 -0
- package/dist/chunks/IconAlertCircleFilled-VxKU8TYK.js.map +1 -0
- package/dist/chunks/IconInfoCircle-L0zfhg7R.js +21 -0
- package/dist/chunks/IconInfoCircle-L0zfhg7R.js.map +1 -0
- package/dist/chunks/animated-height-DhNSac85.js +50 -0
- package/dist/chunks/animated-height-DhNSac85.js.map +1 -0
- package/dist/chunks/basic-page-D1zm81YS.js +481 -0
- package/dist/chunks/basic-page-D1zm81YS.js.map +1 -0
- package/dist/chunks/{close-button-B8gF5UNk.js → button-X5wsWvRa.js} +127 -147
- package/dist/chunks/button-X5wsWvRa.js.map +1 -0
- package/dist/chunks/close-button-xadxp0j8.js +29 -0
- package/dist/chunks/close-button-xadxp0j8.js.map +1 -0
- package/dist/chunks/{dialog--PQoodig.js → dialog-Caze1vkf.js} +84 -79
- package/dist/chunks/dialog-Caze1vkf.js.map +1 -0
- package/dist/chunks/error-DR6G2LmG.js +251 -0
- package/dist/chunks/error-DR6G2LmG.js.map +1 -0
- package/dist/chunks/{input-CxS7ndpb.js → input-D3XQcC4J.js} +29 -31
- package/dist/chunks/input-D3XQcC4J.js.map +1 -0
- package/dist/chunks/{menu-BSXds3Rt.js → menu-BC-9IP29.js} +39 -39
- package/dist/chunks/menu-BC-9IP29.js.map +1 -0
- package/dist/chunks/popover-EL1SE1kj.js +46 -0
- package/dist/chunks/popover-EL1SE1kj.js.map +1 -0
- package/dist/chunks/{sidebar-DLYTxo2j.js → sidebar-DDJC1MeD.js} +2 -2
- package/dist/chunks/{sidebar-DLYTxo2j.js.map → sidebar-DDJC1MeD.js.map} +1 -1
- package/dist/components/button.js +13 -12
- package/dist/components/command.js +126 -162
- package/dist/components/command.js.map +1 -1
- package/dist/components/context-menu.js +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/error.js +13 -0
- package/dist/components/input.js +1 -1
- package/dist/components/menu.js +1 -1
- package/dist/components/notification.js +27 -39
- package/dist/components/notification.js.map +1 -1
- package/dist/components/phone-input.js +1867 -1848
- package/dist/components/phone-input.js.map +1 -1
- package/dist/components/popover.js +2 -43
- package/dist/components/toast.js.map +1 -1
- package/dist/index.js +65 -53
- package/dist/primitives.js +1 -1
- package/dist/sections/basic-page.js +1 -1
- package/dist/sections/sidebar.js +1 -1
- package/dist/src/components/dialog/dialog.d.ts +12 -4
- package/dist/src/components/drawer/drawer.d.ts +2 -2
- package/dist/src/components/error/error.d.ts +56 -0
- package/dist/src/components/error/index.d.ts +2 -0
- package/dist/src/components/error/problem.d.ts +80 -0
- package/dist/src/components/notification/notification.d.ts +1 -1
- package/dist/src/components/phone-input/phone-input.d.ts +7 -1
- package/dist/src/components/toast/toast.d.ts +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/sections/basic-page/basic-page.d.ts +157 -43
- package/dist/src/utils/animated-height.d.ts +4 -1
- package/package.json +5 -5
- package/src/styles/theme.css +27 -0
- package/dist/chunks/basic-page-awtvmT-6.js +0 -270
- package/dist/chunks/basic-page-awtvmT-6.js.map +0 -1
- package/dist/chunks/close-button-B8gF5UNk.js.map +0 -1
- package/dist/chunks/dialog--PQoodig.js.map +0 -1
- package/dist/chunks/input-CxS7ndpb.js.map +0 -1
- package/dist/chunks/menu-BSXds3Rt.js.map +0 -1
- package/dist/components/alert-dialog.js +0 -59
- package/dist/components/alert-dialog.js.map +0 -1
- package/dist/components/popover.js.map +0 -1
- package/dist/src/components/alert-dialog/alert-dialog.d.ts +0 -41
- package/dist/src/components/alert-dialog/index.d.ts +0 -1
|
@@ -1,24 +1,7 @@
|
|
|
1
1
|
import { AnchorHTMLAttributes, ComponentProps, ReactNode, Ref } from 'react';
|
|
2
2
|
import { ButtonLinkProps } from '../../components/button';
|
|
3
|
-
/**
|
|
4
|
-
* BasicPage — Pho's standard content page: a page title, section titles, and
|
|
5
|
-
* bordered cards of label/control rows. Settings, billing, members — any
|
|
6
|
-
* single-column management surface.
|
|
7
|
-
*
|
|
8
|
-
* Spacing: wrap the page in `Root` (a 42rem column with `px-5` gutters,
|
|
9
|
-
* vertical padding). `Stack` separates blocks (`gap-10`). Inside a block,
|
|
10
|
-
* children share `gap-3`. Wrap a section title + description in `Header`
|
|
11
|
-
* (`gap-0.5`) so that pair stays tight — don't put them as loose siblings.
|
|
12
|
-
* Parts already carry `px-5`.
|
|
13
|
-
*
|
|
14
|
-
* Navigation: pages may drill into subpages. `RowLink` is a whole-row link
|
|
15
|
-
* (trailing chevron) and `Back` returns to the parent — both render through
|
|
16
|
-
* the host's `LinkProvider`; the URL itself stays the router's job. `Back`
|
|
17
|
-
* floats in `Root`'s top padding, so `Title` never moves between pages that
|
|
18
|
-
* have a back link and pages that don't.
|
|
19
|
-
*/
|
|
20
3
|
/** Bordered card that stacks rows with hairline dividers. */
|
|
21
|
-
export declare const BASIC_PAGE_CARD = "
|
|
4
|
+
export declare const BASIC_PAGE_CARD = "rounded-base border border-pho-secondary bg-pho-primary divide-y divide-pho-secondary [&>:has(+[data-basic-page-alert])]:border-b-0";
|
|
22
5
|
/**
|
|
23
6
|
* Standalone callout surface — featured block (invite form, notice, etc.).
|
|
24
7
|
* Don't wrap in `Card`; this is the outer chrome.
|
|
@@ -62,33 +45,84 @@ export declare const BASIC_PAGE_ITEM_PANEL_DIVIDED = "-mx-2 -mt-1.5 flex items-c
|
|
|
62
45
|
* so wide viewports render exactly as before while narrow ones keep a 20px
|
|
63
46
|
* breathing edge instead of running content into the viewport.
|
|
64
47
|
*
|
|
65
|
-
* `relative` anchors `Back`, which floats in the top padding
|
|
66
|
-
*
|
|
48
|
+
* `relative` anchors `Back`, which floats in the top padding. The top zone
|
|
49
|
+
* is conditional (`:has()`): pages carrying a `Back` reserve 64px for it;
|
|
50
|
+
* pages without one keep the tighter 48px so the title doesn't sit low.
|
|
51
|
+
*
|
|
52
|
+
* The column is also a `min-h-full` flex stack: when the host gives it a
|
|
53
|
+
* height context (an app shell's scroll pane), a full-page state can claim
|
|
54
|
+
* the leftover viewport with `flex-1` — `ErrorView className="flex-1"`
|
|
55
|
+
* centers itself vertically below the title. Hosts without a height context
|
|
56
|
+
* see a normal column; regular pages are unaffected.
|
|
57
|
+
*
|
|
58
|
+
* Root itself never animates — the page entrance lives on `Stack`, so
|
|
59
|
+
* `Title` and `Back` (the page chrome) stay put while the body below rises
|
|
60
|
+
* in.
|
|
67
61
|
*/
|
|
68
62
|
declare function Root({ className, ...props }: ComponentProps<"div"> & {
|
|
69
63
|
ref?: Ref<HTMLDivElement>;
|
|
70
64
|
}): import("react").JSX.Element;
|
|
65
|
+
export interface BasicPageTitleProps extends ComponentProps<"h1"> {
|
|
66
|
+
/**
|
|
67
|
+
* Shared-element key. Pair with the same `morphId` on the subpage's
|
|
68
|
+
* `Back` and the word morphs between title and back link across the
|
|
69
|
+
* navigation. Skipped under reduced motion.
|
|
70
|
+
*/
|
|
71
|
+
morphId?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Rise this title into its line on mount — for a subpage title whose line
|
|
74
|
+
* an inbound Title ↔ Back morph departs from. The moment the word lifts
|
|
75
|
+
* off, this title floats up from just below it (the Stack physics), so
|
|
76
|
+
* the two form one upward stream and never overlap. Skipped under
|
|
77
|
+
* reduced motion.
|
|
78
|
+
*/
|
|
79
|
+
enter?: boolean;
|
|
80
|
+
ref?: Ref<HTMLHeadingElement>;
|
|
81
|
+
}
|
|
71
82
|
/**
|
|
72
83
|
* Page title — largest heading on the surface. Plain-text children get a slug
|
|
73
84
|
* `id` for hash targets (`#profile`); the heading itself is not a link.
|
|
74
85
|
*/
|
|
75
|
-
declare function Title({ id, className, children, ...props }:
|
|
76
|
-
|
|
77
|
-
|
|
86
|
+
declare function Title({ id, morphId, enter, className, children, ...props }: BasicPageTitleProps): import("react").JSX.Element;
|
|
87
|
+
export interface BasicPageStackProps extends Omit<ComponentProps<"div">, RevealMotionConflicts> {
|
|
88
|
+
ref?: Ref<HTMLDivElement>;
|
|
89
|
+
}
|
|
78
90
|
/**
|
|
79
91
|
* Vertical stack under the page title. Blocks (forms / sections) use `gap-10`;
|
|
80
92
|
* each block lays out its children with `gap-3`.
|
|
93
|
+
*
|
|
94
|
+
* Mounting plays the page entrance: the stack rises 12px and fades in on the
|
|
95
|
+
* Card-shell / Command spring while `Title` / `Back` above stay put. What
|
|
96
|
+
* that means per state:
|
|
97
|
+
*
|
|
98
|
+
* - **Entering the page** — whatever the page first shows (skeleton
|
|
99
|
+
* included) rides in with its stack.
|
|
100
|
+
* - **Skeleton in a separate component** — swapping it for the loaded
|
|
101
|
+
* return mounts a fresh stack, so the entrance replays as the
|
|
102
|
+
* data-arrival animation. That's the right feel for shapes the skeleton
|
|
103
|
+
* couldn't predict (lists of unknown length).
|
|
104
|
+
* - **1:1 skeleton** — keep ONE stack mounted and branch its children
|
|
105
|
+
* (`{pending ? bones : content}`): values then fill in place with no
|
|
106
|
+
* motion.
|
|
107
|
+
*
|
|
108
|
+
* Static under reduced motion.
|
|
81
109
|
*/
|
|
82
|
-
declare function Stack({ className, ...props }:
|
|
83
|
-
ref?: Ref<HTMLDivElement>;
|
|
84
|
-
}): import("react").JSX.Element;
|
|
110
|
+
declare function Stack({ className, ...props }: BasicPageStackProps): import("react").JSX.Element;
|
|
85
111
|
/**
|
|
86
|
-
* Title + optional description pair.
|
|
87
|
-
*
|
|
112
|
+
* Title + optional description pair. No gap between them — the block's
|
|
113
|
+
* `gap-3` only applies between this header and the card.
|
|
88
114
|
*/
|
|
89
|
-
|
|
115
|
+
export interface BasicPageHeaderProps extends Omit<ComponentProps<"div">, RevealMotionConflicts> {
|
|
116
|
+
/**
|
|
117
|
+
* Rise this header into place on mount — the Header flavor of `Title`'s
|
|
118
|
+
* `enter`, for a subpage title that carries a description: the pair
|
|
119
|
+
* floats up from below the departing morph word as one block. Put `enter`
|
|
120
|
+
* here and NOT on the `Title` inside. Skipped under reduced motion.
|
|
121
|
+
*/
|
|
122
|
+
enter?: boolean;
|
|
90
123
|
ref?: Ref<HTMLDivElement>;
|
|
91
|
-
}
|
|
124
|
+
}
|
|
125
|
+
declare function Header({ enter, className, ...props }: BasicPageHeaderProps): import("react").JSX.Element;
|
|
92
126
|
/**
|
|
93
127
|
* Section heading — same padding as the page title, smaller type. Hashable via
|
|
94
128
|
* slug `id` (not a link).
|
|
@@ -111,10 +145,18 @@ declare function Description({ className, ...props }: ComponentProps<"p"> & {
|
|
|
111
145
|
declare function SectionFooter({ className, ...props }: ComponentProps<"p"> & {
|
|
112
146
|
ref?: Ref<HTMLParagraphElement>;
|
|
113
147
|
}): import("react").JSX.Element;
|
|
114
|
-
|
|
115
|
-
|
|
148
|
+
export interface BasicPageCardProps extends ComponentProps<"div"> {
|
|
149
|
+
/**
|
|
150
|
+
* Glide the card's height when its content swaps — bones becoming a
|
|
151
|
+
* different number of rows, a row created or revoked, an inline state
|
|
152
|
+
* change. The height follows the content on the page spring instead of
|
|
153
|
+
* jumping. Reserve it for cards whose contents change while mounted.
|
|
154
|
+
*/
|
|
155
|
+
animateHeight?: boolean;
|
|
116
156
|
ref?: Ref<HTMLDivElement>;
|
|
117
|
-
}
|
|
157
|
+
}
|
|
158
|
+
/** Bordered card that stacks rows with hairline dividers. */
|
|
159
|
+
declare function Card({ animateHeight, className, children, ...props }: BasicPageCardProps): import("react").JSX.Element;
|
|
118
160
|
/**
|
|
119
161
|
* One card row that can host subviews. Padding matches a plain row, so use it
|
|
120
162
|
* for any row that may grow an `ItemPanel` — primary content goes straight in
|
|
@@ -181,25 +223,50 @@ export interface BasicPageRowProps extends Omit<ComponentProps<"div">, "title">
|
|
|
181
223
|
description?: ReactNode;
|
|
182
224
|
/** Associates the label with a control id. When omitted, the label is not a `<label>`. */
|
|
183
225
|
htmlFor?: string;
|
|
226
|
+
/**
|
|
227
|
+
* Stack the label above a full-width control instead of the default
|
|
228
|
+
* label-left / control-right layout at `sm+`. Keeps the compact `gap-3`
|
|
229
|
+
* rhythm — the default row's `justify-between` would otherwise stretch
|
|
230
|
+
* label and control apart under `min-h-[4.25rem]`.
|
|
231
|
+
*/
|
|
232
|
+
stacked?: boolean;
|
|
184
233
|
ref?: Ref<HTMLDivElement>;
|
|
185
234
|
}
|
|
186
235
|
/**
|
|
187
236
|
* One row: label (+ optional description) left, control right.
|
|
188
237
|
* Pass `htmlFor` when the row wraps a labelled input; omit it for display/
|
|
189
|
-
* action rows (avatar, danger-zone delete).
|
|
238
|
+
* action rows (avatar, danger-zone delete). Pass `stacked` for full-width
|
|
239
|
+
* controls that sit under the label.
|
|
190
240
|
*/
|
|
191
|
-
declare function Row({ label, description, htmlFor, className, children, ...props }: BasicPageRowProps): import("react").JSX.Element;
|
|
241
|
+
declare function Row({ label, description, htmlFor, stacked, className, children, ...props }: BasicPageRowProps): import("react").JSX.Element;
|
|
192
242
|
/** Read-only value on the right side of a row (email, etc.). */
|
|
193
243
|
declare function Value({ className, ...props }: ComponentProps<"p"> & {
|
|
194
244
|
ref?: Ref<HTMLParagraphElement>;
|
|
195
245
|
}): import("react").JSX.Element;
|
|
246
|
+
export interface BasicPageAlertProps extends Omit<ComponentProps<"div">, "children"> {
|
|
247
|
+
/** The caught value — a problem body, an `Error` wrapping one, or unknown. */
|
|
248
|
+
error?: unknown;
|
|
249
|
+
/** Override the derived message. */
|
|
250
|
+
children?: ReactNode;
|
|
251
|
+
/**
|
|
252
|
+
* Explicit presence override — defaults to whether there is anything to
|
|
253
|
+
* show, so the reveal plays as the mutation's error comes and goes.
|
|
254
|
+
*/
|
|
255
|
+
show?: boolean;
|
|
256
|
+
ref?: Ref<HTMLDivElement>;
|
|
257
|
+
}
|
|
196
258
|
/**
|
|
197
|
-
*
|
|
198
|
-
*
|
|
259
|
+
* Server error under a row, still inside the card — the partial failure
|
|
260
|
+
* ("Couldn't update your name"), rendered by `Error` from the problem body.
|
|
261
|
+
* Keep it mounted and pass the mutation's error: the line reveals and
|
|
262
|
+
* collapses on `Footer`'s height spring + fade. The card drops its divider
|
|
263
|
+
* above the line so it reads as part of the row it belongs to. Matches card
|
|
264
|
+
* horizontal padding — don't re-apply `px-5`.
|
|
265
|
+
*
|
|
266
|
+
* For a page that failed to load outright, swap the stack for an `ErrorView`
|
|
267
|
+
* instead.
|
|
199
268
|
*/
|
|
200
|
-
declare function Alert({ className, ...props }:
|
|
201
|
-
ref?: Ref<HTMLParagraphElement>;
|
|
202
|
-
}): import("react").JSX.Element;
|
|
269
|
+
declare function Alert({ error, show, className, children, ...props }: BasicPageAlertProps): import("react").JSX.Element;
|
|
203
270
|
export interface BasicPageFooterProps extends ComponentProps<"div"> {
|
|
204
271
|
/**
|
|
205
272
|
* Animated presence for dirty-state bars: the card glides open/closed on a
|
|
@@ -216,11 +283,56 @@ export interface BasicPageFooterProps extends ComponentProps<"div"> {
|
|
|
216
283
|
* out following the onboarding card's motion language.
|
|
217
284
|
*/
|
|
218
285
|
declare function Footer({ show, className, ...props }: BasicPageFooterProps): import("react").JSX.Element;
|
|
286
|
+
/**
|
|
287
|
+
* DOM handlers whose React signatures clash with Motion's gesture props of
|
|
288
|
+
* the same name on `motion.*` elements — excluded from `Reveal`'s public API
|
|
289
|
+
* (same policy as Button).
|
|
290
|
+
*/
|
|
291
|
+
type RevealMotionConflicts = "onAnimationStart" | "onAnimationEnd" | "onAnimationIteration" | "onDrag" | "onDragStart" | "onDragEnd" | "onDragEnter" | "onDragExit" | "onDragLeave" | "onDragOver" | "onDrop";
|
|
292
|
+
export interface BasicPageRevealProps extends Omit<ComponentProps<"div">, RevealMotionConflicts> {
|
|
293
|
+
/**
|
|
294
|
+
* Animated presence for a `Stack` block that comes and goes: keep the
|
|
295
|
+
* block mounted and drive it with `show` — it glides open and closed
|
|
296
|
+
* (height + fade) on the page spring, with the Stack's `gap-10`
|
|
297
|
+
* compensated so nothing jumps when it fully collapses. Omit `show` for
|
|
298
|
+
* the one-shot data-arrival entrance.
|
|
299
|
+
*/
|
|
300
|
+
show?: boolean;
|
|
301
|
+
/**
|
|
302
|
+
* Which gap the presence variant compensates while collapsing —
|
|
303
|
+
* `"stack"` for a Stack block (`gap-10`), `"block"` for an element
|
|
304
|
+
* inside a block (`gap-3`). @default "stack"
|
|
305
|
+
*/
|
|
306
|
+
gap?: "stack" | "block";
|
|
307
|
+
ref?: Ref<HTMLDivElement>;
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Data-arrival entrance for regions whose shape the skeleton couldn't
|
|
311
|
+
* predict — a list of unknown length, a region that depends on the data.
|
|
312
|
+
* Wrap that region (keeping `Title` and 1:1 chrome outside): once the shape
|
|
313
|
+
* is known it rises 12px and fades in on the Card-shell / Command spring,
|
|
314
|
+
* the same physics as the `Footer` / `Alert` reveals. When the skeleton
|
|
315
|
+
* mirrors the loaded layout element for element, skip the reveal — values
|
|
316
|
+
* fill into a shape that never moves. The page *entrance* is separate and
|
|
317
|
+
* already built into `Stack`: whatever the page first shows (including the
|
|
318
|
+
* skeleton) rides that. Static under reduced motion.
|
|
319
|
+
*
|
|
320
|
+
* With `show`, Reveal becomes an animated-presence block instead (the
|
|
321
|
+
* `Footer` grammar): a whole section of the Stack that appears or leaves at
|
|
322
|
+
* runtime glides open/closed while its neighbours follow.
|
|
323
|
+
*/
|
|
324
|
+
declare function Reveal({ show, gap, className, ...props }: BasicPageRevealProps): import("react").JSX.Element;
|
|
219
325
|
export interface BasicPageBackProps extends Omit<ButtonLinkProps, "variant" | "size" | "shape" | "prefix" | "suffix" | "svgOnly" | "href"> {
|
|
220
326
|
/** Parent destination — rendered through the host's `LinkProvider`. */
|
|
221
327
|
href: string;
|
|
222
328
|
/** Label — name the parent page. @default "Back" */
|
|
223
329
|
children?: ReactNode;
|
|
330
|
+
/**
|
|
331
|
+
* Shared-element key. Pair with the same `morphId` on the parent page's
|
|
332
|
+
* `Title` and the word morphs between title and back link across the
|
|
333
|
+
* navigation. Skipped under reduced motion.
|
|
334
|
+
*/
|
|
335
|
+
morphId?: string;
|
|
224
336
|
}
|
|
225
337
|
/**
|
|
226
338
|
* Back link for a subpage — a small ghost `ButtonLink`; place inside `Root`,
|
|
@@ -232,11 +344,11 @@ export interface BasicPageBackProps extends Omit<ButtonLinkProps, "variant" | "s
|
|
|
232
344
|
* 40px in (`px-5` root gutter + `px-5` title pad); inside a `sm` ghost button
|
|
233
345
|
* the label sits 29.75px in (8px icon-side pad + 15.75px chevron, 1.125em at
|
|
234
346
|
* the 14px `text-base`, + 4px gap + 2px label-span `px-0.5`) — so `left` is
|
|
235
|
-
* the 10.25px difference. `top-
|
|
347
|
+
* the 10.25px difference. `top-4` centers the 32px button in the 64px
|
|
236
348
|
* reserved zone. The chevron and the ghost hover pill hang in the padding —
|
|
237
349
|
* the usual optical alignment for borderless controls.
|
|
238
350
|
*/
|
|
239
|
-
declare function Back({ href, className, children, ...props }: BasicPageBackProps): import("react").JSX.Element;
|
|
351
|
+
declare function Back({ href, className, morphId, children, ...props }: BasicPageBackProps): import("react").JSX.Element;
|
|
240
352
|
export interface BasicPageRowLinkProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "href" | "title"> {
|
|
241
353
|
/** Left-side field name — plain text, or compose with a trailing badge. */
|
|
242
354
|
label: ReactNode;
|
|
@@ -252,7 +364,8 @@ export interface BasicPageRowLinkProps extends Omit<AnchorHTMLAttributes<HTMLAnc
|
|
|
252
364
|
}
|
|
253
365
|
/**
|
|
254
366
|
* A row that navigates — the whole row is one link into a subpage, with a
|
|
255
|
-
* trailing chevron cue.
|
|
367
|
+
* trailing chevron cue. Always horizontal: a column stack would park the
|
|
368
|
+
* chevron under the label on narrow viewports. Hover lifts the row, and
|
|
256
369
|
* first/last rows follow the card's corner radius.
|
|
257
370
|
*/
|
|
258
371
|
declare function RowLink({ label, description, leading, href, className, children, ...props }: BasicPageRowLinkProps): import("react").JSX.Element;
|
|
@@ -334,5 +447,6 @@ export declare const BasicPage: {
|
|
|
334
447
|
Value: typeof Value;
|
|
335
448
|
Alert: typeof Alert;
|
|
336
449
|
Footer: typeof Footer;
|
|
450
|
+
Reveal: typeof Reveal;
|
|
337
451
|
};
|
|
338
452
|
export {};
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { ValueAnimationTransition } from 'motion/react';
|
|
2
3
|
/**
|
|
3
4
|
* Animates its own height to follow the measured height of `children`, so
|
|
4
5
|
* content swaps (search filtering, skeleton → data) glide instead of jumping.
|
|
5
6
|
* Honors `prefers-reduced-motion` by snapping height with no spring.
|
|
6
7
|
*/
|
|
7
|
-
export declare function AnimatedHeight({ className, children, }: {
|
|
8
|
+
export declare function AnimatedHeight({ className, transition, children, }: {
|
|
8
9
|
className?: string;
|
|
10
|
+
/** Spring override for the height follow. @default the Command spring */
|
|
11
|
+
transition?: ValueAnimationTransition<number | "auto">;
|
|
9
12
|
children: ReactNode;
|
|
10
13
|
}): import("react").JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@photon-ai/pho-ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Pho Design System — Photon's React component library, built on Base UI",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|
|
@@ -141,10 +141,6 @@
|
|
|
141
141
|
"types": "./dist/src/components/preview-card/index.d.ts",
|
|
142
142
|
"import": "./dist/components/preview-card.js"
|
|
143
143
|
},
|
|
144
|
-
"./components/alert-dialog": {
|
|
145
|
-
"types": "./dist/src/components/alert-dialog/index.d.ts",
|
|
146
|
-
"import": "./dist/components/alert-dialog.js"
|
|
147
|
-
},
|
|
148
144
|
"./components/drawer": {
|
|
149
145
|
"types": "./dist/src/components/drawer/index.d.ts",
|
|
150
146
|
"import": "./dist/components/drawer.js"
|
|
@@ -217,6 +213,10 @@
|
|
|
217
213
|
"types": "./dist/src/components/notification/index.d.ts",
|
|
218
214
|
"import": "./dist/components/notification.js"
|
|
219
215
|
},
|
|
216
|
+
"./components/error": {
|
|
217
|
+
"types": "./dist/src/components/error/index.d.ts",
|
|
218
|
+
"import": "./dist/components/error.js"
|
|
219
|
+
},
|
|
220
220
|
"./sections/sidebar": {
|
|
221
221
|
"types": "./dist/src/sections/sidebar/index.d.ts",
|
|
222
222
|
"import": "./dist/sections/sidebar.js"
|
package/src/styles/theme.css
CHANGED
|
@@ -62,6 +62,33 @@
|
|
|
62
62
|
Display: xs/sm/base/md/lg/xl/2xl = 18/20/24/32/40/48/60.
|
|
63
63
|
NOTE: the reset wipes the whole --text-* prefix; every --text-color-pho-*
|
|
64
64
|
token is declared AFTER this point in the file, so it survives. */
|
|
65
|
+
/* The iOS-measured page spring (stiffness 400, damping 40, ~330ms),
|
|
66
|
+
pre-sampled as a CSS linear() easing so plain transitions (Menu,
|
|
67
|
+
Popover popups) ride the same glide as the Motion springs. */
|
|
68
|
+
--ease-pho-spring: linear(
|
|
69
|
+
0,
|
|
70
|
+
0.04429 5%,
|
|
71
|
+
0.1435 10%,
|
|
72
|
+
0.2633 15%,
|
|
73
|
+
0.3842 20%,
|
|
74
|
+
0.4962 25%,
|
|
75
|
+
0.5947 30%,
|
|
76
|
+
0.6785 35%,
|
|
77
|
+
0.748 40%,
|
|
78
|
+
0.8046 45%,
|
|
79
|
+
0.8502 50%,
|
|
80
|
+
0.8864 55%,
|
|
81
|
+
0.9149 60%,
|
|
82
|
+
0.9372 65%,
|
|
83
|
+
0.9545 70%,
|
|
84
|
+
0.9679 75%,
|
|
85
|
+
0.9781 80%,
|
|
86
|
+
0.986 85%,
|
|
87
|
+
0.992 90%,
|
|
88
|
+
0.9965 95%,
|
|
89
|
+
1
|
|
90
|
+
);
|
|
91
|
+
|
|
65
92
|
--text-*: initial;
|
|
66
93
|
--text-xs: 0.8125rem;
|
|
67
94
|
--text-xs--line-height: 1.125rem;
|
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { t as n } from "./cn-DTiB6ek_.js";
|
|
3
|
-
import { n as d } from "./link-provider-9TFNyDqO.js";
|
|
4
|
-
import { s as f } from "./close-button-B8gF5UNk.js";
|
|
5
|
-
import { t as x } from "./createReactComponent-BqCmnqfX.js";
|
|
6
|
-
import { t as h } from "./IconChevronLeft-CSWMKQ4C.js";
|
|
7
|
-
import { Children as v } from "react";
|
|
8
|
-
import { jsx as r, jsxs as s } from "react/jsx-runtime";
|
|
9
|
-
import { AnimatePresence as g, motion as y, useReducedMotion as N } from "motion/react";
|
|
10
|
-
var b = [["path", {
|
|
11
|
-
d: "M9 6l6 6l-6 6",
|
|
12
|
-
key: "svg-0"
|
|
13
|
-
}]], A = x("outline", "chevron-right", "ChevronRight", b), C = "divide-y divide-pho-secondary rounded-base border border-pho-secondary bg-pho-primary", p = "flex flex-col gap-3 rounded-base border border-pho-secondary bg-pho-page p-5", m = "flex min-h-[4.25rem] flex-col gap-3 px-5 py-4 sm:flex-row sm:items-center sm:justify-between sm:gap-6", _ = "flex flex-col gap-3 px-5 py-4", w = "-mx-5 -mb-4 flex items-center rounded-b-[calc(0.75rem-1px)] bg-pho-secondary py-1 pr-3 pl-5", I = "-mx-2 -mt-1.5 flex items-center rounded-sm bg-pho-secondary px-2 py-0.5";
|
|
14
|
-
function E({ className: e, ...t }) {
|
|
15
|
-
return /* @__PURE__ */ r("div", {
|
|
16
|
-
className: n("relative mx-auto w-full max-w-[44.5rem] px-5 py-12", e),
|
|
17
|
-
...t
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
function P(e) {
|
|
21
|
-
return e.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
22
|
-
}
|
|
23
|
-
function R(e) {
|
|
24
|
-
if (!(typeof e != "string" && typeof e != "number"))
|
|
25
|
-
return P(String(e)) || void 0;
|
|
26
|
-
}
|
|
27
|
-
function c(e, t) {
|
|
28
|
-
if (e !== "")
|
|
29
|
-
return e ?? R(t);
|
|
30
|
-
}
|
|
31
|
-
function L({ id: e, className: t, children: a, ...i }) {
|
|
32
|
-
return /* @__PURE__ */ r("h1", {
|
|
33
|
-
id: c(e, a),
|
|
34
|
-
className: n("text-display-base text-pho-primary scroll-mt-12 px-5 font-medium", t),
|
|
35
|
-
...i,
|
|
36
|
-
children: a
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
function S({ className: e, ...t }) {
|
|
40
|
-
return /* @__PURE__ */ r("div", {
|
|
41
|
-
className: n("mt-6 flex flex-col gap-10", "*:flex *:flex-col *:gap-3", e),
|
|
42
|
-
...t
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
function B({ className: e, ...t }) {
|
|
46
|
-
return /* @__PURE__ */ r("div", {
|
|
47
|
-
className: n("flex flex-col gap-0.5", e),
|
|
48
|
-
...t
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
function k({ id: e, className: t, children: a, ...i }) {
|
|
52
|
-
return /* @__PURE__ */ r("h2", {
|
|
53
|
-
id: c(e, a),
|
|
54
|
-
className: n("text-display-xs text-pho-primary scroll-mt-12 px-5 font-medium", t),
|
|
55
|
-
...i,
|
|
56
|
-
children: a
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
function D({ className: e, ...t }) {
|
|
60
|
-
return /* @__PURE__ */ r("p", {
|
|
61
|
-
className: n("text-display-xs text-pho-description px-5 font-normal", e),
|
|
62
|
-
...t
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
function G({ className: e, ...t }) {
|
|
66
|
-
return /* @__PURE__ */ r("p", {
|
|
67
|
-
className: n("text-pho-description px-5 text-xs font-normal", e),
|
|
68
|
-
...t
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
function T({ className: e, ...t }) {
|
|
72
|
-
return /* @__PURE__ */ r("div", {
|
|
73
|
-
className: n(C, e),
|
|
74
|
-
...t
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
function z({ className: e, ...t }) {
|
|
78
|
-
return /* @__PURE__ */ r("div", {
|
|
79
|
-
className: n(_, e),
|
|
80
|
-
...t
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
function M({ divided: e = !1, className: t, ...a }) {
|
|
84
|
-
return /* @__PURE__ */ r("div", {
|
|
85
|
-
className: n(e ? I : w, t),
|
|
86
|
-
...a
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
function H({ className: e, icon: t, children: a, ...i }) {
|
|
90
|
-
if (t == null || t === !1 || t === !0) return /* @__PURE__ */ r("div", {
|
|
91
|
-
className: n(p, e),
|
|
92
|
-
...i,
|
|
93
|
-
children: a
|
|
94
|
-
});
|
|
95
|
-
const [o, ...l] = v.toArray(a);
|
|
96
|
-
return /* @__PURE__ */ s("div", {
|
|
97
|
-
className: n(p, e),
|
|
98
|
-
...i,
|
|
99
|
-
children: [/* @__PURE__ */ s("div", {
|
|
100
|
-
className: "relative",
|
|
101
|
-
children: [/* @__PURE__ */ r("div", {
|
|
102
|
-
className: "min-w-0 pr-16",
|
|
103
|
-
children: o
|
|
104
|
-
}), /* @__PURE__ */ r("div", {
|
|
105
|
-
"aria-hidden": !0,
|
|
106
|
-
className: "text-pho-description pointer-events-none absolute top-1/2 right-0 size-14 -translate-y-1/2 opacity-50 [&>svg]:size-full",
|
|
107
|
-
children: t
|
|
108
|
-
})]
|
|
109
|
-
}), l]
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
function j({ id: e, className: t, children: a, ...i }) {
|
|
113
|
-
return /* @__PURE__ */ r("h2", {
|
|
114
|
-
id: c(e, a),
|
|
115
|
-
className: n("text-display-xs text-pho-primary scroll-mt-12 font-medium", t),
|
|
116
|
-
...i,
|
|
117
|
-
children: a
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
function F({ className: e, ...t }) {
|
|
121
|
-
return /* @__PURE__ */ r("p", {
|
|
122
|
-
className: n("text-display-xs text-pho-description font-normal", e),
|
|
123
|
-
...t
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
function V({ label: e, description: t, htmlFor: a, className: i, children: o, ...l }) {
|
|
127
|
-
return /* @__PURE__ */ s("div", {
|
|
128
|
-
className: n(m, i),
|
|
129
|
-
...l,
|
|
130
|
-
children: [/* @__PURE__ */ s("div", {
|
|
131
|
-
className: "min-w-0",
|
|
132
|
-
children: [a ? /* @__PURE__ */ r("label", {
|
|
133
|
-
htmlFor: a,
|
|
134
|
-
className: "text-pho-primary block text-base font-normal",
|
|
135
|
-
children: e
|
|
136
|
-
}) : /* @__PURE__ */ r("p", {
|
|
137
|
-
className: "text-pho-primary text-base font-normal",
|
|
138
|
-
children: e
|
|
139
|
-
}), t ? /* @__PURE__ */ r("p", {
|
|
140
|
-
className: "text-pho-description mt-0.5 text-xs",
|
|
141
|
-
children: t
|
|
142
|
-
}) : null]
|
|
143
|
-
}), /* @__PURE__ */ r("div", {
|
|
144
|
-
className: "flex w-full min-w-0 items-center gap-2 sm:w-auto",
|
|
145
|
-
children: o
|
|
146
|
-
})]
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
function O({ className: e, ...t }) {
|
|
150
|
-
return /* @__PURE__ */ r("p", {
|
|
151
|
-
className: n("text-pho-description truncate text-base", e),
|
|
152
|
-
...t
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
function K({ className: e, ...t }) {
|
|
156
|
-
return /* @__PURE__ */ r("p", {
|
|
157
|
-
role: "alert",
|
|
158
|
-
className: n("text-pho-error px-5 pb-3 text-xs", e),
|
|
159
|
-
...t
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
var U = {
|
|
163
|
-
type: "spring",
|
|
164
|
-
stiffness: 640,
|
|
165
|
-
damping: 50
|
|
166
|
-
}, W = {
|
|
167
|
-
duration: 0.18,
|
|
168
|
-
ease: "easeOut"
|
|
169
|
-
};
|
|
170
|
-
function $({ show: e, className: t, ...a }) {
|
|
171
|
-
const i = N(), o = /* @__PURE__ */ r("div", {
|
|
172
|
-
className: n("flex items-center justify-between gap-6 px-5 py-4", t),
|
|
173
|
-
...a
|
|
174
|
-
});
|
|
175
|
-
return e === void 0 ? o : /* @__PURE__ */ r(g, {
|
|
176
|
-
initial: !1,
|
|
177
|
-
children: e ? /* @__PURE__ */ r(y.div, {
|
|
178
|
-
className: "overflow-hidden",
|
|
179
|
-
initial: {
|
|
180
|
-
height: 0,
|
|
181
|
-
opacity: 0
|
|
182
|
-
},
|
|
183
|
-
animate: {
|
|
184
|
-
height: "auto",
|
|
185
|
-
opacity: 1
|
|
186
|
-
},
|
|
187
|
-
exit: {
|
|
188
|
-
height: 0,
|
|
189
|
-
opacity: 0
|
|
190
|
-
},
|
|
191
|
-
transition: i ? { duration: 0 } : {
|
|
192
|
-
height: U,
|
|
193
|
-
opacity: W
|
|
194
|
-
},
|
|
195
|
-
children: o
|
|
196
|
-
}) : null
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
function q({ href: e, className: t, children: a = "Back", ...i }) {
|
|
200
|
-
return /* @__PURE__ */ r(f, {
|
|
201
|
-
variant: "ghost",
|
|
202
|
-
size: "sm",
|
|
203
|
-
href: e,
|
|
204
|
-
prefix: /* @__PURE__ */ r(h, {}),
|
|
205
|
-
className: n("absolute top-2 left-[10.25px]", t),
|
|
206
|
-
...i,
|
|
207
|
-
children: a
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
function J({ label: e, description: t, leading: a, href: i, className: o, children: l, ...u }) {
|
|
211
|
-
return /* @__PURE__ */ s(d(), {
|
|
212
|
-
href: i,
|
|
213
|
-
...u,
|
|
214
|
-
className: n(m, "group outline-pho-brand hover:bg-pho-primary-hover cursor-pointer transition-colors focus-visible:outline-2 focus-visible:-outline-offset-2", "first:rounded-t-[calc(var(--radius-base)-1px)] last:rounded-b-[calc(var(--radius-base)-1px)]", o),
|
|
215
|
-
children: [/* @__PURE__ */ s("div", {
|
|
216
|
-
className: n("flex min-w-0 items-center", a != null && "gap-3"),
|
|
217
|
-
children: [a, /* @__PURE__ */ s("div", {
|
|
218
|
-
className: "min-w-0",
|
|
219
|
-
children: [/* @__PURE__ */ r("div", {
|
|
220
|
-
className: "flex min-w-0 items-center gap-1",
|
|
221
|
-
children: typeof e == "string" || typeof e == "number" ? /* @__PURE__ */ r("p", {
|
|
222
|
-
className: "text-pho-primary truncate text-base font-medium",
|
|
223
|
-
children: e
|
|
224
|
-
}) : e
|
|
225
|
-
}), t ? /* @__PURE__ */ r("div", {
|
|
226
|
-
className: "text-pho-description text-xs",
|
|
227
|
-
children: t
|
|
228
|
-
}) : null]
|
|
229
|
-
})]
|
|
230
|
-
}), /* @__PURE__ */ s("div", {
|
|
231
|
-
className: "flex w-full min-w-0 items-center gap-2 sm:w-auto",
|
|
232
|
-
children: [l, /* @__PURE__ */ r(A, {
|
|
233
|
-
"aria-hidden": !0,
|
|
234
|
-
className: "text-pho-secondary group-hover:text-pho-secondary-hover size-4 shrink-0 transition-colors"
|
|
235
|
-
})]
|
|
236
|
-
})]
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
var ne = {
|
|
240
|
-
Root: E,
|
|
241
|
-
Back: q,
|
|
242
|
-
Title: L,
|
|
243
|
-
Stack: S,
|
|
244
|
-
Header: B,
|
|
245
|
-
SectionTitle: k,
|
|
246
|
-
Description: D,
|
|
247
|
-
SectionFooter: G,
|
|
248
|
-
Card: T,
|
|
249
|
-
Item: z,
|
|
250
|
-
ItemPanel: M,
|
|
251
|
-
Callout: H,
|
|
252
|
-
CalloutTitle: j,
|
|
253
|
-
CalloutDescription: F,
|
|
254
|
-
Row: V,
|
|
255
|
-
RowLink: J,
|
|
256
|
-
Value: O,
|
|
257
|
-
Alert: K,
|
|
258
|
-
Footer: $
|
|
259
|
-
};
|
|
260
|
-
export {
|
|
261
|
-
I as a,
|
|
262
|
-
w as i,
|
|
263
|
-
C as n,
|
|
264
|
-
m as o,
|
|
265
|
-
_ as r,
|
|
266
|
-
ne as s,
|
|
267
|
-
p as t
|
|
268
|
-
};
|
|
269
|
-
|
|
270
|
-
//# sourceMappingURL=basic-page-awtvmT-6.js.map
|