@photon-ai/pho-ui 2.7.0 → 2.8.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 (72) hide show
  1. package/dist/chunks/basic-page-BI8y4hHk.js +1449 -0
  2. package/dist/chunks/basic-page-BI8y4hHk.js.map +1 -0
  3. package/dist/chunks/{checkbox-Cdm08HWG.js → checkbox-CznlNhDY.js} +40 -37
  4. package/dist/chunks/checkbox-CznlNhDY.js.map +1 -0
  5. package/dist/chunks/data-table-Cmz0p-jt.js +279 -0
  6. package/dist/chunks/data-table-Cmz0p-jt.js.map +1 -0
  7. package/dist/chunks/rolldown-runtime-wKSmTnsc.js +22 -0
  8. package/dist/components/accordion.js +87 -28
  9. package/dist/components/accordion.js.map +1 -1
  10. package/dist/components/checkbox.js +1 -1
  11. package/dist/components/data-table.js +1 -1
  12. package/dist/components/phone-input.js +1 -1
  13. package/dist/components/radio-group.js +50 -43
  14. package/dist/components/radio-group.js.map +1 -1
  15. package/dist/components/select.js +7 -7
  16. package/dist/components/select.js.map +1 -1
  17. package/dist/index.js +2 -2
  18. package/dist/primitives/accordion.js +1 -1
  19. package/dist/primitives/alert-dialog.js +1 -1
  20. package/dist/primitives/autocomplete.js +1 -1
  21. package/dist/primitives/avatar.js +1 -1
  22. package/dist/primitives/button.js +1 -1
  23. package/dist/primitives/checkbox-group.js +1 -1
  24. package/dist/primitives/checkbox.js +1 -1
  25. package/dist/primitives/collapsible.js +1 -1
  26. package/dist/primitives/combobox.js +1 -1
  27. package/dist/primitives/context-menu.js +1 -1
  28. package/dist/primitives/csp-provider.js +1 -1
  29. package/dist/primitives/dialog.js +1 -1
  30. package/dist/primitives/direction-provider.js +1 -1
  31. package/dist/primitives/drawer.js +1 -1
  32. package/dist/primitives/field.js +1 -1
  33. package/dist/primitives/fieldset.js +1 -1
  34. package/dist/primitives/form.js +1 -1
  35. package/dist/primitives/input.js +1 -1
  36. package/dist/primitives/menu.js +1 -1
  37. package/dist/primitives/menubar.js +1 -1
  38. package/dist/primitives/meter.js +1 -1
  39. package/dist/primitives/navigation-menu.js +1 -1
  40. package/dist/primitives/number-field.js +1 -1
  41. package/dist/primitives/otp-field.js +1 -1
  42. package/dist/primitives/popover.js +1 -1
  43. package/dist/primitives/preview-card.js +1 -1
  44. package/dist/primitives/progress.js +1 -1
  45. package/dist/primitives/radio-group.js +1 -1
  46. package/dist/primitives/radio.js +1 -1
  47. package/dist/primitives/scroll-area.js +1 -1
  48. package/dist/primitives/select.js +1 -1
  49. package/dist/primitives/separator.js +1 -1
  50. package/dist/primitives/slider.js +1 -1
  51. package/dist/primitives/switch.js +1 -1
  52. package/dist/primitives/tabs.js +1 -1
  53. package/dist/primitives/toast.js +1 -1
  54. package/dist/primitives/toggle-group.js +1 -1
  55. package/dist/primitives/toggle.js +1 -1
  56. package/dist/primitives/toolbar.js +1 -1
  57. package/dist/primitives/tooltip.js +1 -1
  58. package/dist/primitives.js +1 -1
  59. package/dist/sections/basic-page.js +2 -2
  60. package/dist/src/components/accordion/accordion.d.ts +45 -8
  61. package/dist/src/components/checkbox/checkbox-card.d.ts +2 -1
  62. package/dist/src/components/data-table/data-table.d.ts +3 -2
  63. package/dist/src/components/radio-group/radio-card.d.ts +3 -2
  64. package/dist/src/sections/basic-page/basic-page.d.ts +43 -11
  65. package/package.json +1 -1
  66. package/src/styles/theme.css +54 -0
  67. package/dist/chunks/basic-page-DR5szOOs.js +0 -1373
  68. package/dist/chunks/basic-page-DR5szOOs.js.map +0 -1
  69. package/dist/chunks/checkbox-Cdm08HWG.js.map +0 -1
  70. package/dist/chunks/data-table-DwbPU0zt.js +0 -2970
  71. package/dist/chunks/data-table-DwbPU0zt.js.map +0 -1
  72. package/dist/chunks/rolldown-runtime-DG5F_Nuu.js +0 -27
@@ -4,19 +4,56 @@ import { Accordion as BaseAccordion } from '@base-ui/react/accordion';
4
4
  type StyledProps<T extends ElementType> = Omit<ComponentProps<T>, "className"> & {
5
5
  className?: string;
6
6
  };
7
- declare function Root({ className, ...props }: StyledProps<typeof BaseAccordion.Root>): import("react").JSX.Element;
7
+ export type AccordionSize = "sm" | "md" | "lg";
8
+ export interface AccordionRootProps extends StyledProps<typeof BaseAccordion.Root> {
9
+ /** @default "md" */
10
+ size?: AccordionSize;
11
+ }
12
+ /**
13
+ * The list — bare, so the page decides the surface: on photon.codes the
14
+ * FAQ card is the section's, 32px around the list; in a settings page it
15
+ * is a `Card`. Items divide with a hairline and the list has no outer
16
+ * lines. Items are independent, as on the site, so `multiple` is on
17
+ * unless said otherwise.
18
+ */
19
+ declare function Root({ className, multiple, size, ...props }: AccordionRootProps): import("react").JSX.Element;
20
+ /**
21
+ * One question, padded above and below, whatever is open inside. The
22
+ * hairline under it overlaps the next item by its own pixel, the way
23
+ * Framer draws a border inside the box, so an item advances by exactly
24
+ * its padding and its rows: 68px at `lg`, the site's figure. The last
25
+ * item draws none.
26
+ */
27
+ declare function Item({ className, ...props }: StyledProps<typeof BaseAccordion.Item>): import("react").JSX.Element;
8
28
  declare function Header({ className, ...props }: StyledProps<typeof BaseAccordion.Header>): import("react").JSX.Element;
9
- declare function Trigger({ className, ...props }: StyledProps<typeof BaseAccordion.Trigger>): import("react").JSX.Element;
10
- declare function Panel({ className, ...props }: StyledProps<typeof BaseAccordion.Panel>): import("react").JSX.Element;
11
29
  /**
12
- * Stacked, individually-collapsible sections built on Base UI `Accordion`.
13
- * Single-open by default; set `openMultiple` to allow several at once. Each
14
- * `Accordion.Item` needs a `value`; control the open set with `value` /
15
- * `onValueChange` or `defaultValue`.
30
+ * The question row: the question in medium with the chevron at the row's
31
+ * end. The chevron is the site's small one (a 6.5×3.5 stroke in a 24px
32
+ * box, weight 1.5) and the trigger wears it itself — pass only the
33
+ * question. Open, the question settles to the description tone and the
34
+ * chevron makes a half turn, both on the section spring; the chevron keeps
35
+ * the primary ink. The whole item is the target, as on the site: the hit
36
+ * area reaches through the item's padding above and below the row.
37
+ */
38
+ declare function Trigger({ className, children, ...props }: StyledProps<typeof BaseAccordion.Trigger>): import("react").JSX.Element;
39
+ /**
40
+ * The answer: medium in the primary ink, one type step under the
41
+ * question, a short gap below it. Opening, the panel's height rides the
42
+ * section spring while the answer arrives 100ms later on the appear
43
+ * spring, fading in as it rises 20px. Closing, the answer is gone at once
44
+ * and the height settles on the section spring — the site's way round.
45
+ */
46
+ declare function Panel({ className, children, ...props }: StyledProps<typeof BaseAccordion.Panel>): import("react").JSX.Element;
47
+ /**
48
+ * Questions that each reveal an answer — photon.codes's FAQ, as a
49
+ * component, built on Base UI `Accordion`. Each `Accordion.Item` needs a
50
+ * `value`; control the open set with `value` / `onValueChange` or
51
+ * `defaultValue`. Items are independent by default; `multiple={false}`
52
+ * opens one at a time. Three sizes; `lg` is the site's.
16
53
  */
17
54
  export declare const Accordion: {
18
55
  Root: typeof Root;
19
- Item: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').AccordionItemProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
56
+ Item: typeof Item;
20
57
  Header: typeof Header;
21
58
  Trigger: typeof Trigger;
22
59
  Panel: typeof Panel;
@@ -11,7 +11,8 @@ export interface CheckboxCardProps extends Omit<ComponentProps<typeof BaseCheckb
11
11
  }
12
12
  /**
13
13
  * A `Checkbox` styled as a bordered, selectable tile — title, optional
14
- * description, and either a stacked icon or the checkbox box. The tile is a
14
+ * description, and either a stacked icon above them or the checkbox box at
15
+ * the end of the title row. The tile is a
15
16
  * `<label>` around the control so clicks (including on the icon/title) are a
16
17
  * trusted activation of the hidden input Base UI renders beside the root.
17
18
  */
@@ -110,9 +110,10 @@ export interface DataTableProps<TData extends RowData> extends Omit<ComponentPro
110
110
  /**
111
111
  * Rows that navigate: each row is one link into a subpage, through the
112
112
  * host's `LinkProvider`. Beside a `BasicPage.Aside`, the subpage opens
113
- * next to the table.
113
+ * next to the table. Return nothing for a row with no page yet (one
114
+ * still in flight) and that row stays plain.
114
115
  */
115
- rowHref?: (row: TData) => string;
116
+ rowHref?: (row: TData) => string | null | undefined;
116
117
  /** The row whose page is open (its id) — it keeps the wash. */
117
118
  current?: string | null;
118
119
  /**
@@ -11,8 +11,9 @@ export interface RadioCardProps extends Omit<ComponentProps<typeof BaseRadio.Roo
11
11
  }
12
12
  /**
13
13
  * A `Radio` styled as a bordered, selectable tile — title, optional
14
- * description, and either a stacked icon or the radio dot. The tile *is*
15
- * the radio (see `usePressPulse`); an inner glyph is decorative.
14
+ * description, and either a stacked icon above them or the radio dot at
15
+ * the end of the title row. The tile *is* the radio (see `usePressPulse`);
16
+ * an inner glyph is decorative.
16
17
  */
17
18
  export declare function RadioCard({ className, title, description, icon, disabled, ...props }: RadioCardProps): import("react").JSX.Element;
18
19
  export declare namespace RadioCard {
@@ -211,6 +211,16 @@ export interface BasicPageHeaderProps extends Omit<ComponentProps<"div">, Reveal
211
211
  ref?: Ref<HTMLDivElement>;
212
212
  }
213
213
  declare function Header({ enter, className, ...props }: BasicPageHeaderProps): import("react").JSX.Element;
214
+ /**
215
+ * An action at the header row's end — a small button (or two) seated in
216
+ * the `Header` grid the way `Search` is: top-right of the block, its top
217
+ * edge on the title row, flush with the card edge below. Put it inside
218
+ * `Header` after the text; with a `Search` present it stands to the
219
+ * search's right.
220
+ */
221
+ declare function HeaderAction({ className, ...props }: ComponentProps<"div"> & {
222
+ ref?: Ref<HTMLDivElement>;
223
+ }): import("react").JSX.Element;
214
224
  /**
215
225
  * Section heading — same padding as the page title, smaller type. Hashable via
216
226
  * slug `id` (not a link).
@@ -679,8 +689,25 @@ export interface BasicPageAsideProps {
679
689
  */
680
690
  open?: boolean;
681
691
  /**
682
- * The empty panel's face — a quiet line that says what opens here.
683
- * Optional; without it the reserved panel stands empty.
692
+ * How the panel meets the page on a wide pane. `overlay`, the default,
693
+ * floats over the page's right edge: it takes no ground, surfaces when
694
+ * a subpage opens and leaves with it, and the page beneath stays live.
695
+ * `inline` docks it: the panel's ground is reserved from the first
696
+ * paint, the page beside it never reflows as subpages open and close,
697
+ * and `placeholder` wears the empty panel.
698
+ */
699
+ variant?: "overlay" | "inline";
700
+ /**
701
+ * For an overlay: dim the page behind and keep interaction in the panel.
702
+ * Focus stays inside, the backdrop is a way out, Escape still closes.
703
+ * Off by default, so the page stays live under the panel and opening
704
+ * another row swaps the panel's page.
705
+ */
706
+ modal?: boolean;
707
+ /**
708
+ * The empty inline panel's face — a quiet line that says what opens
709
+ * here. Optional; without it the reserved panel stands empty. An
710
+ * overlay has no empty face: closed, it is not there.
684
711
  */
685
712
  placeholder?: ReactNode;
686
713
  /**
@@ -692,17 +719,21 @@ export interface BasicPageAsideProps {
692
719
  }
693
720
  /**
694
721
  * A subpage beside the page. On a pane wide enough for two columns (48rem,
695
- * Tailwind's `md`) it is a panel at the right edge, and the panel holds
696
- * its ground from the first paint: the page beside it never reflows as
722
+ * Tailwind's `md`) it is a panel at the right edge. By default the panel
723
+ * floats: it takes no ground, surfaces over the page's edge when a
724
+ * subpage opens and leaves with it, and the page beneath stays live
725
+ * unless `modal` dims it. `variant="inline"` docks it: the panel holds
726
+ * its ground from the first paint, the page beside it never reflows as
697
727
  * subpages open and close — only the panel's face changes, `placeholder`
698
- * while empty, the subpage while one is open. The subpage scrolls on its
699
- * own, its `Back` is the close in the corner, Escape closes too. On a
700
- * narrower pane the same subpage is the page — the list steps aside, the
701
- * subpage takes the pane with its own `Back` — so one subpage component
702
- * serves both. Works under either `Root` width: the page keeps its own
703
- * column cap beside the panel, and leftover space is margin.
728
+ * while empty, the subpage while one is open. Either way the subpage
729
+ * scrolls on its own, its `Back` is the close in the corner, Escape
730
+ * closes too. On a narrower pane the same subpage is the page — the list
731
+ * steps aside, the subpage takes the pane with its own `Back` — so one
732
+ * subpage component serves both. Works under either `Root` width: the
733
+ * page keeps its own column cap beside the panel, and leftover space is
734
+ * margin.
704
735
  */
705
- declare function Aside({ open, placeholder, onClose, children }: BasicPageAsideProps): import('react').ReactPortal | null;
736
+ declare function Aside({ open, variant, modal, placeholder, onClose, children, }: BasicPageAsideProps): import("react").JSX.Element | null;
706
737
  /**
707
738
  * The table's search, standing at the end of a section header — put it in
708
739
  * the `Header` beside the title and it adopts the searchable table's box
@@ -736,6 +767,7 @@ export declare const BasicPage: {
736
767
  Title: typeof Title;
737
768
  Stack: typeof Stack;
738
769
  Header: typeof Header;
770
+ HeaderAction: typeof HeaderAction;
739
771
  SectionTitle: typeof SectionTitle;
740
772
  Description: typeof Description;
741
773
  TableCount: typeof TableCount;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@photon-ai/pho-ui",
3
- "version": "2.7.0",
3
+ "version": "2.8.0",
4
4
  "description": "Pho Design System — Photon's React component library, built on Base UI",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -89,6 +89,60 @@
89
89
  1
90
90
  );
91
91
 
92
+ /* photon.codes's section spring (Framer spring-physics 436 42 1; critically
93
+ damped, settled by 500ms): an accordion item's height, its chevron's
94
+ half turn, and the question's tone all ride it. Sampled over 500ms. */
95
+ --ease-pho-spring-reveal: linear(
96
+ 0,
97
+ 0.097 5%,
98
+ 0.2805 10%,
99
+ 0.4642 15%,
100
+ 0.6175 20%,
101
+ 0.7348 25%,
102
+ 0.82 30%,
103
+ 0.8798 35%,
104
+ 0.9208 40%,
105
+ 0.9484 45%,
106
+ 0.9667 50%,
107
+ 0.9787 55%,
108
+ 0.9865 60%,
109
+ 0.9915 65%,
110
+ 0.9948 70%,
111
+ 0.9968 75%,
112
+ 0.9981 80%,
113
+ 0.999 85%,
114
+ 0.9995 90%,
115
+ 0.9998 95%,
116
+ 1
117
+ );
118
+
119
+ /* photon.codes's appear effect (Framer spring-physics 417 68 1; overdamped,
120
+ a long soft tail): content fading in and rising into place. Sampled
121
+ over 700ms; pair it with the site's 100ms delay. */
122
+ --ease-pho-spring-appear: linear(
123
+ 0,
124
+ 0.1294 5%,
125
+ 0.3063 10%,
126
+ 0.4544 15%,
127
+ 0.5721 20%,
128
+ 0.6649 25%,
129
+ 0.7381 30%,
130
+ 0.7957 35%,
131
+ 0.8411 40%,
132
+ 0.8769 45%,
133
+ 0.905 50%,
134
+ 0.9272 55%,
135
+ 0.9447 60%,
136
+ 0.9585 65%,
137
+ 0.9693 70%,
138
+ 0.9779 75%,
139
+ 0.9846 80%,
140
+ 0.9899 85%,
141
+ 0.9941 90%,
142
+ 0.9974 95%,
143
+ 1
144
+ );
145
+
92
146
  --text-*: initial;
93
147
  --text-xs: 0.8125rem;
94
148
  --text-xs--line-height: 1.125rem;