@photon-ai/pho-ui 4.0.0 → 4.3.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-DlLTmGnH.js → basic-page-65eFgq8o.js} +674 -670
- package/dist/chunks/basic-page-65eFgq8o.js.map +1 -0
- package/dist/chunks/card-N-tvFsuV.js +64 -0
- package/dist/chunks/card-N-tvFsuV.js.map +1 -0
- package/dist/chunks/{command-CTYrSz9a.js → command-ZagVyDx7.js} +2 -2
- package/dist/chunks/{command-CTYrSz9a.js.map → command-ZagVyDx7.js.map} +1 -1
- package/dist/chunks/date-picker-CZbcNIe-.js +428 -0
- package/dist/chunks/date-picker-CZbcNIe-.js.map +1 -0
- package/dist/chunks/{dialog-BwfUFn6B.js → dialog-BYiAFetB.js} +4 -4
- package/dist/chunks/{dialog-BwfUFn6B.js.map → dialog-BYiAFetB.js.map} +1 -1
- package/dist/chunks/{filter-bar-D9lBBr4z.js → filter-bar-DTaLgQr0.js} +2 -2
- package/dist/chunks/{filter-bar-D9lBBr4z.js.map → filter-bar-DTaLgQr0.js.map} +1 -1
- package/dist/components/card.js +1 -1
- package/dist/components/command.js +1 -1
- package/dist/components/date-picker.js +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/filter-bar.js +1 -1
- package/dist/index.js +5 -5
- package/dist/sections/basic-page.js +1 -1
- package/dist/src/components/card/card.d.ts +20 -4
- package/dist/src/components/date-picker/date-picker.d.ts +40 -3
- package/dist/src/components/date-picker/index.d.ts +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/sections/basic-page/basic-page.d.ts +17 -6
- package/package.json +1 -1
- package/dist/chunks/basic-page-DlLTmGnH.js.map +0 -1
- package/dist/chunks/card-DhDwtSi9.js +0 -56
- package/dist/chunks/card-DhDwtSi9.js.map +0 -1
- package/dist/chunks/date-picker-DnQuw-B1.js +0 -404
- package/dist/chunks/date-picker-DnQuw-B1.js.map +0 -1
|
@@ -6,7 +6,10 @@ import { ComponentProps, Ref } from 'react';
|
|
|
6
6
|
* (menus, dialogs); see the same rule on Input and Select.
|
|
7
7
|
* - Radius sits at the `lg` stop (16px) like Dialog — a standalone content
|
|
8
8
|
* panel reads bigger than a control, so it takes the panel radius rather
|
|
9
|
-
* than the control default (`base`).
|
|
9
|
+
* than the control default (`base`). `overflow-hidden` clips with it:
|
|
10
|
+
* a flush `Stat.Group` (opaque tiles, `pt-0`) would otherwise paint
|
|
11
|
+
* square over the curve. The same clip is what makes an edge-to-edge
|
|
12
|
+
* image or table follow the panel, the way `BasicPage.Card` already does.
|
|
10
13
|
* - Vertical rhythm: `pt-5` / `pb-4`, `gap-4` between parts. Parts carry
|
|
11
14
|
* `px-5`, so a child without padding (an image, a table, a `Separator`)
|
|
12
15
|
* runs edge-to-edge on its own. A `Stat` / `Stat.Group` already pads
|
|
@@ -18,12 +21,16 @@ import { ComponentProps, Ref } from 'react';
|
|
|
18
21
|
* tone. Sizing belongs to the layout that places the card.
|
|
19
22
|
*/
|
|
20
23
|
/** Surface chrome — exported for hosts that need the look on another element. */
|
|
21
|
-
export declare const CARD_SURFACE = "border-pho-secondary bg-pho-primary rounded-lg border";
|
|
24
|
+
export declare const CARD_SURFACE = "border-pho-secondary bg-pho-primary overflow-hidden rounded-lg border";
|
|
22
25
|
/** The panel: bordered surface, vertical rhythm between parts. */
|
|
23
26
|
declare function Root({ className, ...props }: ComponentProps<"div"> & {
|
|
24
27
|
ref?: Ref<HTMLDivElement>;
|
|
25
28
|
}): import("react").JSX.Element;
|
|
26
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* Title row + optional description. The title and a trailing `Value`
|
|
31
|
+
* share the first line; the description sits on the next with no row
|
|
32
|
+
* gap — title and subtitle read as one block.
|
|
33
|
+
*/
|
|
27
34
|
declare function Header({ className, ...props }: ComponentProps<"div"> & {
|
|
28
35
|
ref?: Ref<HTMLDivElement>;
|
|
29
36
|
}): import("react").JSX.Element;
|
|
@@ -34,7 +41,14 @@ declare function Header({ className, ...props }: ComponentProps<"div"> & {
|
|
|
34
41
|
declare function Title({ className, children, ...props }: ComponentProps<"h3"> & {
|
|
35
42
|
ref?: Ref<HTMLHeadingElement>;
|
|
36
43
|
}): import("react").JSX.Element;
|
|
37
|
-
/**
|
|
44
|
+
/**
|
|
45
|
+
* A count or figure at the end of the title row. One display step above
|
|
46
|
+
* the title, primary ink — the number is the loud thing on the line.
|
|
47
|
+
*/
|
|
48
|
+
declare function Value({ className, ...props }: ComponentProps<"div"> & {
|
|
49
|
+
ref?: Ref<HTMLDivElement>;
|
|
50
|
+
}): import("react").JSX.Element;
|
|
51
|
+
/** Supporting copy under the title — Dialog's description: same step, description ink. */
|
|
38
52
|
declare function Description({ className, ...props }: ComponentProps<"p"> & {
|
|
39
53
|
ref?: Ref<HTMLParagraphElement>;
|
|
40
54
|
}): import("react").JSX.Element;
|
|
@@ -59,6 +73,7 @@ declare function Footer({ className, ...props }: ComponentProps<"div"> & {
|
|
|
59
73
|
* <Card.Root>
|
|
60
74
|
* <Card.Header>
|
|
61
75
|
* <Card.Title>Usage</Card.Title>
|
|
76
|
+
* <Card.Value>1.2k</Card.Value>
|
|
62
77
|
* <Card.Description>Since Aug 1.</Card.Description>
|
|
63
78
|
* </Card.Header>
|
|
64
79
|
* <Card.Content>…</Card.Content>
|
|
@@ -72,6 +87,7 @@ export declare const Card: {
|
|
|
72
87
|
Root: typeof Root;
|
|
73
88
|
Header: typeof Header;
|
|
74
89
|
Title: typeof Title;
|
|
90
|
+
Value: typeof Value;
|
|
75
91
|
Description: typeof Description;
|
|
76
92
|
Content: typeof Content;
|
|
77
93
|
Footer: typeof Footer;
|
|
@@ -16,7 +16,7 @@ export type DatePickerTime = "hour" | "minute" | "second";
|
|
|
16
16
|
*/
|
|
17
17
|
export declare function dateFieldMask(locales?: Intl.LocalesArgument, time?: DatePickerTime): string;
|
|
18
18
|
/**
|
|
19
|
-
* The figures in the field — `09/12/2026`, or `09/10/2026
|
|
19
|
+
* The figures in the field — `09/12/2026`, or `09/10/2026–09/13/2026` for a
|
|
20
20
|
* span, in the viewer's locale. An empty or half-finished range prints just
|
|
21
21
|
* the day that is settled; nothing selected prints nothing. Pass `time` to
|
|
22
22
|
* print the clock too, at the precision that was asked for.
|
|
@@ -34,6 +34,10 @@ export interface DatePickerPreset<T> {
|
|
|
34
34
|
label: string;
|
|
35
35
|
value: T | (() => T);
|
|
36
36
|
}
|
|
37
|
+
/** Extra about a change — present when the value came from a named window. */
|
|
38
|
+
export interface DatePickerChangeDetails<T> {
|
|
39
|
+
preset: DatePickerPreset<T>;
|
|
40
|
+
}
|
|
37
41
|
interface DatePickerBaseProps {
|
|
38
42
|
/** Field label (associated for accessibility). */
|
|
39
43
|
label?: ReactNode;
|
|
@@ -51,6 +55,13 @@ interface DatePickerBaseProps {
|
|
|
51
55
|
required?: boolean;
|
|
52
56
|
/** Size variant. @default "md" */
|
|
53
57
|
size?: DatePickerSize;
|
|
58
|
+
/**
|
|
59
|
+
* `fill` takes the column it is in, like every other field. `hug` shrinks
|
|
60
|
+
* to the words it is showing, for a field that sits in a toolbar or beside
|
|
61
|
+
* a title rather than in a form.
|
|
62
|
+
* @default "fill"
|
|
63
|
+
*/
|
|
64
|
+
width?: "fill" | "hug";
|
|
54
65
|
/**
|
|
55
66
|
* Ask for a time as well as a day, this fine. `hour` sets the hour and
|
|
56
67
|
* zeroes the rest, `minute` the hour and minute, `second` all three. Omit
|
|
@@ -68,13 +79,32 @@ interface DatePickerBaseProps {
|
|
|
68
79
|
id?: string;
|
|
69
80
|
/** Class applied to the trigger. */
|
|
70
81
|
className?: string;
|
|
82
|
+
/**
|
|
83
|
+
* Accessible name when there is no visible label — a toolbar control
|
|
84
|
+
* beside a page title, which already says what the field is for.
|
|
85
|
+
*/
|
|
86
|
+
"aria-label"?: string;
|
|
87
|
+
/**
|
|
88
|
+
* The named window the field should read. A page that already knows the
|
|
89
|
+
* name (`Last 24 hours` in the URL) passes it so a remount, and a rolling
|
|
90
|
+
* window recomputed each render, still write the name rather than the
|
|
91
|
+
* figures. The name drops the moment the value is no longer that window
|
|
92
|
+
* — a day picked by hand, or the page clearing this.
|
|
93
|
+
*/
|
|
94
|
+
selectedPreset?: string;
|
|
95
|
+
/**
|
|
96
|
+
* How the popover lines up with the field. A hug field on the right of a
|
|
97
|
+
* header wants `end`, so the calendar grows left instead of off-screen.
|
|
98
|
+
* @default "start"
|
|
99
|
+
*/
|
|
100
|
+
align?: "start" | "center" | "end";
|
|
71
101
|
}
|
|
72
102
|
export interface DatePickerSingleProps extends DatePickerBaseProps {
|
|
73
103
|
/** @default "single" */
|
|
74
104
|
mode?: "single";
|
|
75
105
|
value?: Date;
|
|
76
106
|
defaultValue?: Date;
|
|
77
|
-
onValueChange?: (value: Date | undefined) => void;
|
|
107
|
+
onValueChange?: (value: Date | undefined, details?: DatePickerChangeDetails<Date>) => void;
|
|
78
108
|
/** Named days offered beside the calendar. */
|
|
79
109
|
presets?: DatePickerPreset<Date>[];
|
|
80
110
|
}
|
|
@@ -82,9 +112,16 @@ export interface DatePickerRangeProps extends DatePickerBaseProps {
|
|
|
82
112
|
mode: "range";
|
|
83
113
|
value?: DateRange;
|
|
84
114
|
defaultValue?: DateRange;
|
|
85
|
-
onValueChange?: (value: DateRange | undefined) => void;
|
|
115
|
+
onValueChange?: (value: DateRange | undefined, details?: DatePickerChangeDetails<DateRange>) => void;
|
|
86
116
|
/** Named windows offered beside the calendar — `Last 7 days`, and so on. */
|
|
87
117
|
presets?: DatePickerPreset<DateRange>[];
|
|
118
|
+
/**
|
|
119
|
+
* Shortest and longest span the viewer may pick, counted in days. A pick
|
|
120
|
+
* that would break either restarts the span from the day just clicked, so
|
|
121
|
+
* the bound is felt rather than explained.
|
|
122
|
+
*/
|
|
123
|
+
minDays?: number;
|
|
124
|
+
maxDays?: number;
|
|
88
125
|
}
|
|
89
126
|
export type DatePickerProps = DatePickerSingleProps | DatePickerRangeProps;
|
|
90
127
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { DatePicker, formatDateLabel, type DatePickerProps, type DatePickerSingleProps, type DatePickerRangeProps, type DatePickerSize, } from './date-picker';
|
|
1
|
+
export { DatePicker, formatDateLabel, type DatePickerProps, type DatePickerSingleProps, type DatePickerRangeProps, type DatePickerSize, type DatePickerPreset, type DatePickerChangeDetails, } from './date-picker';
|
|
2
2
|
export type { DateRange } from 'react-day-picker';
|
package/dist/src/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export * from './utils';
|
|
|
9
9
|
export * from './motion';
|
|
10
10
|
export * from './components/button';
|
|
11
11
|
export * from './components/calendar';
|
|
12
|
-
export { DatePicker, formatDateLabel, type DatePickerProps, type DatePickerSingleProps, type DatePickerRangeProps, type DatePickerSize, } from './components/date-picker';
|
|
12
|
+
export { DatePicker, formatDateLabel, type DatePickerProps, type DatePickerSingleProps, type DatePickerRangeProps, type DatePickerSize, type DatePickerPreset, type DatePickerChangeDetails, } from './components/date-picker';
|
|
13
13
|
export * from './components/input';
|
|
14
14
|
export * from './components/input-group';
|
|
15
15
|
export * from './components/card';
|
|
@@ -95,6 +95,11 @@ export interface BasicPageRootProps extends ComponentProps<"div"> {
|
|
|
95
95
|
* starting values would blink it out. The React page taking over from
|
|
96
96
|
* it stays put too — it finds the marker in the document at its first
|
|
97
97
|
* render, while the twin is still there.
|
|
98
|
+
*
|
|
99
|
+
* Not needed for markup React hydrates in place (a server-rendered
|
|
100
|
+
* page): the parts know a hydration pass from a mount and stay at rest
|
|
101
|
+
* on their own. This is for the twin that mounts fresh, beside or over
|
|
102
|
+
* markup it does not hydrate.
|
|
98
103
|
*/
|
|
99
104
|
prerendered?: boolean;
|
|
100
105
|
}
|
|
@@ -222,7 +227,8 @@ export interface BasicPageStackProps extends Omit<ComponentProps<"div">, RevealM
|
|
|
222
227
|
* second the page was painted before React and is already there. A
|
|
223
228
|
* loading part in some other page (one still on screen while this one
|
|
224
229
|
* mounts) does not count. `true` always enters, except inside a
|
|
225
|
-
* `Root prerendered
|
|
230
|
+
* `Root prerendered` or while hydrating server markup (the page is on
|
|
231
|
+
* screen either way); `false` never does.
|
|
226
232
|
*/
|
|
227
233
|
enter?: boolean;
|
|
228
234
|
ref?: Ref<HTMLDivElement>;
|
|
@@ -253,6 +259,11 @@ export interface BasicPageStackProps extends Omit<ComponentProps<"div">, RevealM
|
|
|
253
259
|
* nothing inside that root does either, and the React page taking over
|
|
254
260
|
* finds the marker in the document and stays put on its own;
|
|
255
261
|
* `enter={false}` says so outright for markup that must never move.
|
|
262
|
+
* - **A page the server rendered and React hydrates** stays put with no
|
|
263
|
+
* flag at all: the hydration pass renders what the server did, at rest,
|
|
264
|
+
* and the entrance waits for a page React mounts itself (a navigation).
|
|
265
|
+
* An `enter` on a hydrating stack does not override this either: the
|
|
266
|
+
* page is on screen, and starting values would blink it out.
|
|
256
267
|
* - **A region the skeleton couldn't predict** (a list of unknown length)
|
|
257
268
|
* — `Reveal` rises that region in once its shape is known.
|
|
258
269
|
*
|
|
@@ -867,9 +878,9 @@ export interface BasicPageAsideProps {
|
|
|
867
878
|
onClose?: () => void;
|
|
868
879
|
/**
|
|
869
880
|
* How wide the panel is on a pane that can host it. `default` (unsaid)
|
|
870
|
-
* is two fifths of the pane, 20–28rem. `wide` is
|
|
871
|
-
* — a request body or a waterfall. Below `md` the subpage is
|
|
872
|
-
* and this does not apply.
|
|
881
|
+
* is two fifths of the pane, 20–28rem. `wide` is two thirds of the pane,
|
|
882
|
+
* 28–48rem — a request body or a waterfall. Below `md` the subpage is
|
|
883
|
+
* the page and this does not apply.
|
|
873
884
|
*/
|
|
874
885
|
width?: BasicPageAsideWidth;
|
|
875
886
|
/**
|
|
@@ -912,8 +923,8 @@ export interface BasicPageAsideProps {
|
|
|
912
923
|
* steps aside, the subpage takes the pane with its own `Back` — so one
|
|
913
924
|
* subpage component serves both. Works under either `Root` width: the
|
|
914
925
|
* page keeps its own column cap beside the panel, and leftover space is
|
|
915
|
-
* margin. `width="wide"` opens the panel itself (
|
|
916
|
-
*
|
|
926
|
+
* margin. `width="wide"` opens the panel itself (two thirds of the pane,
|
|
927
|
+
* up to 48rem); the page's column cap does not follow.
|
|
917
928
|
*
|
|
918
929
|
* Panel or page is presentation, not routing: the URL is the subpage's
|
|
919
930
|
* either way. Left to itself the aside reads how it was reached — a
|