@photon-ai/pho-ui 4.2.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.
Files changed (30) hide show
  1. package/dist/chunks/{basic-page-C3qjXfBe.js → basic-page-65eFgq8o.js} +407 -407
  2. package/dist/chunks/basic-page-65eFgq8o.js.map +1 -0
  3. package/dist/chunks/card-N-tvFsuV.js +64 -0
  4. package/dist/chunks/card-N-tvFsuV.js.map +1 -0
  5. package/dist/chunks/{command-CTYrSz9a.js → command-ZagVyDx7.js} +2 -2
  6. package/dist/chunks/{command-CTYrSz9a.js.map → command-ZagVyDx7.js.map} +1 -1
  7. package/dist/chunks/date-picker-CZbcNIe-.js +428 -0
  8. package/dist/chunks/date-picker-CZbcNIe-.js.map +1 -0
  9. package/dist/chunks/{dialog-BwfUFn6B.js → dialog-BYiAFetB.js} +4 -4
  10. package/dist/chunks/{dialog-BwfUFn6B.js.map → dialog-BYiAFetB.js.map} +1 -1
  11. package/dist/chunks/{filter-bar-D9lBBr4z.js → filter-bar-DTaLgQr0.js} +2 -2
  12. package/dist/chunks/{filter-bar-D9lBBr4z.js.map → filter-bar-DTaLgQr0.js.map} +1 -1
  13. package/dist/components/card.js +1 -1
  14. package/dist/components/command.js +1 -1
  15. package/dist/components/date-picker.js +1 -1
  16. package/dist/components/dialog.js +1 -1
  17. package/dist/components/filter-bar.js +1 -1
  18. package/dist/index.js +5 -5
  19. package/dist/sections/basic-page.js +1 -1
  20. package/dist/src/components/card/card.d.ts +20 -4
  21. package/dist/src/components/date-picker/date-picker.d.ts +25 -2
  22. package/dist/src/components/date-picker/index.d.ts +1 -1
  23. package/dist/src/index.d.ts +1 -1
  24. package/dist/src/sections/basic-page/basic-page.d.ts +5 -5
  25. package/package.json +1 -1
  26. package/dist/chunks/basic-page-C3qjXfBe.js.map +0 -1
  27. package/dist/chunks/card-DhDwtSi9.js +0 -56
  28. package/dist/chunks/card-DhDwtSi9.js.map +0 -1
  29. package/dist/chunks/date-picker-Ddeo1fNE.js +0 -422
  30. package/dist/chunks/date-picker-Ddeo1fNE.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
- /** Title + optional description pair, kept tight (`gap-0.5`). */
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
- /** Supporting copy under the title — same step, secondary tone. */
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;
@@ -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;
@@ -75,13 +79,32 @@ interface DatePickerBaseProps {
75
79
  id?: string;
76
80
  /** Class applied to the trigger. */
77
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";
78
101
  }
79
102
  export interface DatePickerSingleProps extends DatePickerBaseProps {
80
103
  /** @default "single" */
81
104
  mode?: "single";
82
105
  value?: Date;
83
106
  defaultValue?: Date;
84
- onValueChange?: (value: Date | undefined) => void;
107
+ onValueChange?: (value: Date | undefined, details?: DatePickerChangeDetails<Date>) => void;
85
108
  /** Named days offered beside the calendar. */
86
109
  presets?: DatePickerPreset<Date>[];
87
110
  }
@@ -89,7 +112,7 @@ export interface DatePickerRangeProps extends DatePickerBaseProps {
89
112
  mode: "range";
90
113
  value?: DateRange;
91
114
  defaultValue?: DateRange;
92
- onValueChange?: (value: DateRange | undefined) => void;
115
+ onValueChange?: (value: DateRange | undefined, details?: DatePickerChangeDetails<DateRange>) => void;
93
116
  /** Named windows offered beside the calendar — `Last 7 days`, and so on. */
94
117
  presets?: DatePickerPreset<DateRange>[];
95
118
  /**
@@ -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';
@@ -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';
@@ -878,9 +878,9 @@ export interface BasicPageAsideProps {
878
878
  onClose?: () => void;
879
879
  /**
880
880
  * How wide the panel is on a pane that can host it. `default` (unsaid)
881
- * is two fifths of the pane, 20–28rem. `wide` is half the pane, 25–40rem
882
- * — a request body or a waterfall. Below `md` the subpage is the page
883
- * 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.
884
884
  */
885
885
  width?: BasicPageAsideWidth;
886
886
  /**
@@ -923,8 +923,8 @@ export interface BasicPageAsideProps {
923
923
  * steps aside, the subpage takes the pane with its own `Back` — so one
924
924
  * subpage component serves both. Works under either `Root` width: the
925
925
  * page keeps its own column cap beside the panel, and leftover space is
926
- * margin. `width="wide"` opens the panel itself (half the pane, up to
927
- * 40rem); the page's column cap does not follow.
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.
928
928
  *
929
929
  * Panel or page is presentation, not routing: the URL is the subpage's
930
930
  * either way. Left to itself the aside reads how it was reached — a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@photon-ai/pho-ui",
3
- "version": "4.2.0",
3
+ "version": "4.3.0",
4
4
  "description": "Pho Design System — Photon's React component library, built on Base UI",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {