@photon-ai/pho-ui 1.5.0 → 2.0.1

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 (67) hide show
  1. package/dist/chunks/IconAlertCircleFilled-VxKU8TYK.js +11 -0
  2. package/dist/chunks/IconAlertCircleFilled-VxKU8TYK.js.map +1 -0
  3. package/dist/chunks/IconInfoCircle-L0zfhg7R.js +21 -0
  4. package/dist/chunks/IconInfoCircle-L0zfhg7R.js.map +1 -0
  5. package/dist/chunks/animated-height-DhNSac85.js +50 -0
  6. package/dist/chunks/animated-height-DhNSac85.js.map +1 -0
  7. package/dist/chunks/basic-page-D1zm81YS.js +481 -0
  8. package/dist/chunks/basic-page-D1zm81YS.js.map +1 -0
  9. package/dist/chunks/{close-button-B8gF5UNk.js → button-X5wsWvRa.js} +127 -147
  10. package/dist/chunks/button-X5wsWvRa.js.map +1 -0
  11. package/dist/chunks/close-button-xadxp0j8.js +29 -0
  12. package/dist/chunks/close-button-xadxp0j8.js.map +1 -0
  13. package/dist/chunks/{dialog--PQoodig.js → dialog-Caze1vkf.js} +84 -79
  14. package/dist/chunks/dialog-Caze1vkf.js.map +1 -0
  15. package/dist/chunks/error-DR6G2LmG.js +251 -0
  16. package/dist/chunks/error-DR6G2LmG.js.map +1 -0
  17. package/dist/chunks/{input-CxS7ndpb.js → input-D3XQcC4J.js} +29 -31
  18. package/dist/chunks/input-D3XQcC4J.js.map +1 -0
  19. package/dist/chunks/{menu-BSXds3Rt.js → menu-BC-9IP29.js} +39 -39
  20. package/dist/chunks/menu-BC-9IP29.js.map +1 -0
  21. package/dist/chunks/popover-EL1SE1kj.js +46 -0
  22. package/dist/chunks/popover-EL1SE1kj.js.map +1 -0
  23. package/dist/chunks/{sidebar-DLYTxo2j.js → sidebar-DDJC1MeD.js} +2 -2
  24. package/dist/chunks/{sidebar-DLYTxo2j.js.map → sidebar-DDJC1MeD.js.map} +1 -1
  25. package/dist/components/button.js +13 -12
  26. package/dist/components/command.js +126 -162
  27. package/dist/components/command.js.map +1 -1
  28. package/dist/components/context-menu.js +1 -1
  29. package/dist/components/dialog.js +1 -1
  30. package/dist/components/drawer.js.map +1 -1
  31. package/dist/components/error.js +13 -0
  32. package/dist/components/input.js +1 -1
  33. package/dist/components/menu.js +1 -1
  34. package/dist/components/notification.js +27 -39
  35. package/dist/components/notification.js.map +1 -1
  36. package/dist/components/phone-input.js +1867 -1848
  37. package/dist/components/phone-input.js.map +1 -1
  38. package/dist/components/popover.js +2 -43
  39. package/dist/components/toast.js.map +1 -1
  40. package/dist/index.js +65 -53
  41. package/dist/primitives.js +1 -1
  42. package/dist/sections/basic-page.js +1 -1
  43. package/dist/sections/sidebar.js +1 -1
  44. package/dist/src/components/dialog/dialog.d.ts +12 -4
  45. package/dist/src/components/drawer/drawer.d.ts +2 -2
  46. package/dist/src/components/error/error.d.ts +56 -0
  47. package/dist/src/components/error/index.d.ts +2 -0
  48. package/dist/src/components/error/problem.d.ts +80 -0
  49. package/dist/src/components/notification/notification.d.ts +1 -1
  50. package/dist/src/components/phone-input/phone-input.d.ts +7 -1
  51. package/dist/src/components/toast/toast.d.ts +1 -1
  52. package/dist/src/index.d.ts +1 -0
  53. package/dist/src/sections/basic-page/basic-page.d.ts +159 -45
  54. package/dist/src/utils/animated-height.d.ts +4 -1
  55. package/package.json +5 -5
  56. package/src/styles/theme.css +27 -0
  57. package/dist/chunks/basic-page-awtvmT-6.js +0 -270
  58. package/dist/chunks/basic-page-awtvmT-6.js.map +0 -1
  59. package/dist/chunks/close-button-B8gF5UNk.js.map +0 -1
  60. package/dist/chunks/dialog--PQoodig.js.map +0 -1
  61. package/dist/chunks/input-CxS7ndpb.js.map +0 -1
  62. package/dist/chunks/menu-BSXds3Rt.js.map +0 -1
  63. package/dist/components/alert-dialog.js +0 -59
  64. package/dist/components/alert-dialog.js.map +0 -1
  65. package/dist/components/popover.js.map +0 -1
  66. package/dist/src/components/alert-dialog/alert-dialog.d.ts +0 -41
  67. package/dist/src/components/alert-dialog/index.d.ts +0 -1
@@ -1,46 +1,5 @@
1
1
  "use client";
2
- import { t as e } from "../chunks/cn-DTiB6ek_.js";
3
- import "react";
4
- import { jsx as a } from "react/jsx-runtime";
5
- import { Popover as t } from "@base-ui/react/popover";
6
- var n = t.Root, s = t.Trigger, p = t.Portal, c = t.Close;
7
- function m({ className: r, sideOffset: o = 8, ...i }) {
8
- return /* @__PURE__ */ a(t.Positioner, {
9
- sideOffset: o,
10
- className: e("z-50", r),
11
- ...i
12
- });
13
- }
14
- function l({ className: r, ...o }) {
15
- return /* @__PURE__ */ a(t.Popup, {
16
- className: e("bg-pho-primary text-pho-primary shadow-pho-lg ring-pho-secondary rounded-base max-w-[calc(100vw-2rem)] origin-[var(--transform-origin)] p-4 ring-1 transition-[transform,opacity] duration-150 ease-out outline-none ring-inset", "data-[starting-style]:scale-95 data-[starting-style]:opacity-0", "data-[ending-style]:scale-95 data-[ending-style]:opacity-0", r),
17
- ...o
18
- });
19
- }
20
- function u({ className: r, ...o }) {
21
- return /* @__PURE__ */ a(t.Title, {
22
- className: e("text-pho-primary text-base font-medium", r),
23
- ...o
24
- });
25
- }
26
- function g({ className: r, ...o }) {
27
- return /* @__PURE__ */ a(t.Description, {
28
- className: e("text-pho-description mt-1 text-base", r),
29
- ...o
30
- });
31
- }
32
- var P = {
33
- Root: n,
34
- Trigger: s,
35
- Portal: p,
36
- Positioner: m,
37
- Popup: l,
38
- Title: u,
39
- Description: g,
40
- Close: c
41
- };
2
+ import { t as e } from "../chunks/popover-EL1SE1kj.js";
42
3
  export {
43
- P as Popover
4
+ e as Popover
44
5
  };
45
-
46
- //# sourceMappingURL=popover.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"toast.js","names":[],"sources":["../../src/components/toast/toast.tsx"],"sourcesContent":["import { type ComponentProps, type ElementType } from \"react\";\nimport { Toast as BaseToast } from \"@base-ui/react/toast\";\nimport { cn } from \"../../utils/cn\";\n\n/** Override Base UI's `string | (state) => string` className with plain string. */\ntype StyledProps<T extends ElementType> = Omit<\n ComponentProps<T>,\n \"className\"\n> & {\n className?: string;\n};\n\nconst Provider = BaseToast.Provider;\nconst Portal = BaseToast.Portal;\nconst Action = BaseToast.Action;\n\n/** Imperative toast API: `const toast = useToastManager(); toast.add({ title })`. */\nconst useToastManager = BaseToast.useToastManager;\nconst createToastManager = BaseToast.createToastManager;\n\nfunction Viewport({\n className,\n ...props\n}: StyledProps<typeof BaseToast.Viewport>) {\n return (\n <BaseToast.Viewport\n className={cn(\n \"fixed right-4 bottom-4 z-50 flex w-[22rem] max-w-[calc(100vw-2rem)] flex-col gap-2 outline-none\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Root({ className, ...props }: StyledProps<typeof BaseToast.Root>) {\n return (\n <BaseToast.Root\n className={cn(\n // Floating layer: keeps its elevation shadow, sits on the card surface\n // with the site hairline (ring-pho-secondary).\n \"bg-pho-primary text-pho-primary shadow-pho-lg ring-pho-secondary rounded-base relative w-full ring-1 select-none ring-inset\",\n \"[transform:translateX(var(--toast-swipe-movement-x,0px))] transition-[transform,opacity] duration-300 ease-out\",\n \"data-[starting-style]:translate-x-full data-[starting-style]:opacity-0\",\n \"data-[ending-style]:translate-x-full data-[ending-style]:opacity-0\",\n \"data-[swiping]:duration-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Content({\n className,\n ...props\n}: StyledProps<typeof BaseToast.Content>) {\n return (\n <BaseToast.Content\n className={cn(\"flex flex-col gap-1 p-4 pr-10\", className)}\n {...props}\n />\n );\n}\n\nfunction Title({ className, ...props }: StyledProps<typeof BaseToast.Title>) {\n return (\n <BaseToast.Title\n className={cn(\"text-pho-primary text-base font-medium\", className)}\n {...props}\n />\n );\n}\n\nfunction Description({\n className,\n ...props\n}: StyledProps<typeof BaseToast.Description>) {\n return (\n <BaseToast.Description\n className={cn(\"text-pho-description text-base\", className)}\n {...props}\n />\n );\n}\n\nfunction Close({ className, ...props }: StyledProps<typeof BaseToast.Close>) {\n return (\n <BaseToast.Close\n className={cn(\n \"text-pho-secondary hover:text-pho-secondary-hover hover:bg-pho-ghost-hover outline-pho-brand absolute top-2.5 right-2.5 flex size-6 cursor-pointer items-center justify-center rounded-sm transition focus-visible:outline-2 [&>svg]:size-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Toast built on Base UI `Toast` — a transient, non-blocking notification.\n * Wrap your app in `Toast.Provider`, render a `Toast.Portal` → `Viewport` that\n * maps `useToastManager().toasts` to `Toast.Root`s, then call\n * `useToastManager().add({ title, description })` to show one. Use a toast for\n * confirmation of a background action; for a choice the user must make, use\n * `AlertDialog`.\n */\nexport const Toast = {\n Provider,\n Portal,\n Viewport,\n Root,\n Content,\n Title,\n Description,\n Close,\n Action,\n useToastManager,\n createToastManager,\n};\n"],"mappings":";;;;;AAYA,IAAM,IAAW,EAAU,UACrB,IAAS,EAAU,QACnB,IAAS,EAAU,QAGnB,IAAkB,EAAU,iBAC5B,IAAqB,EAAU;AAErC,SAAS,EAAS,EAChB,WAAA,GACA,GAAG,EAAA,GACsC;AACzC,SACE,gBAAA,EAAC,EAAU,UAAX;AAAA,IACE,WAAW,EACT,mGACA,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAK,EAAE,WAAA,GAAW,GAAG,EAAA,GAA6C;AACzE,SACE,gBAAA,EAAC,EAAU,MAAX;AAAA,IACE,WAAW,EAGT,+HACA,kHACA,0EACA,sEACA,6BACA,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAQ,EACf,WAAA,GACA,GAAG,EAAA,GACqC;AACxC,SACE,gBAAA,EAAC,EAAU,SAAX;AAAA,IACE,WAAW,EAAG,iCAAiC,CAAS;AAAA,IACxD,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAM,EAAE,WAAA,GAAW,GAAG,EAAA,GAA8C;AAC3E,SACE,gBAAA,EAAC,EAAU,OAAX;AAAA,IACE,WAAW,EAAG,0CAA0C,CAAS;AAAA,IACjE,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAY,EACnB,WAAA,GACA,GAAG,EAAA,GACyC;AAC5C,SACE,gBAAA,EAAC,EAAU,aAAX;AAAA,IACE,WAAW,EAAG,kCAAkC,CAAS;AAAA,IACzD,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAM,EAAE,WAAA,GAAW,GAAG,EAAA,GAA8C;AAC3E,SACE,gBAAA,EAAC,EAAU,OAAX;AAAA,IACE,WAAW,EACT,+OACA,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AAUA,IAAa,IAAQ;AAAA,EACnB,UAAA;AAAA,EACA,QAAA;AAAA,EACA,UAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA,OAAA;AAAA,EACA,aAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,iBAAA;AAAA,EACA,oBAAA;AACF"}
1
+ {"version":3,"file":"toast.js","names":[],"sources":["../../src/components/toast/toast.tsx"],"sourcesContent":["import { type ComponentProps, type ElementType } from \"react\";\nimport { Toast as BaseToast } from \"@base-ui/react/toast\";\nimport { cn } from \"../../utils/cn\";\n\n/** Override Base UI's `string | (state) => string` className with plain string. */\ntype StyledProps<T extends ElementType> = Omit<\n ComponentProps<T>,\n \"className\"\n> & {\n className?: string;\n};\n\nconst Provider = BaseToast.Provider;\nconst Portal = BaseToast.Portal;\nconst Action = BaseToast.Action;\n\n/** Imperative toast API: `const toast = useToastManager(); toast.add({ title })`. */\nconst useToastManager = BaseToast.useToastManager;\nconst createToastManager = BaseToast.createToastManager;\n\nfunction Viewport({\n className,\n ...props\n}: StyledProps<typeof BaseToast.Viewport>) {\n return (\n <BaseToast.Viewport\n className={cn(\n \"fixed right-4 bottom-4 z-50 flex w-[22rem] max-w-[calc(100vw-2rem)] flex-col gap-2 outline-none\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Root({ className, ...props }: StyledProps<typeof BaseToast.Root>) {\n return (\n <BaseToast.Root\n className={cn(\n // Floating layer: keeps its elevation shadow, sits on the card surface\n // with the site hairline (ring-pho-secondary).\n \"bg-pho-primary text-pho-primary shadow-pho-lg ring-pho-secondary rounded-base relative w-full ring-1 select-none ring-inset\",\n \"[transform:translateX(var(--toast-swipe-movement-x,0px))] transition-[transform,opacity] duration-300 ease-out\",\n \"data-[starting-style]:translate-x-full data-[starting-style]:opacity-0\",\n \"data-[ending-style]:translate-x-full data-[ending-style]:opacity-0\",\n \"data-[swiping]:duration-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Content({\n className,\n ...props\n}: StyledProps<typeof BaseToast.Content>) {\n return (\n <BaseToast.Content\n className={cn(\"flex flex-col gap-1 p-4 pr-10\", className)}\n {...props}\n />\n );\n}\n\nfunction Title({ className, ...props }: StyledProps<typeof BaseToast.Title>) {\n return (\n <BaseToast.Title\n className={cn(\"text-pho-primary text-base font-medium\", className)}\n {...props}\n />\n );\n}\n\nfunction Description({\n className,\n ...props\n}: StyledProps<typeof BaseToast.Description>) {\n return (\n <BaseToast.Description\n className={cn(\"text-pho-description text-base\", className)}\n {...props}\n />\n );\n}\n\nfunction Close({ className, ...props }: StyledProps<typeof BaseToast.Close>) {\n return (\n <BaseToast.Close\n className={cn(\n \"text-pho-secondary hover:text-pho-secondary-hover hover:bg-pho-ghost-hover outline-pho-brand absolute top-2.5 right-2.5 flex size-6 cursor-pointer items-center justify-center rounded-sm transition focus-visible:outline-2 [&>svg]:size-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Toast built on Base UI `Toast` — a transient, non-blocking notification.\n * Wrap your app in `Toast.Provider`, render a `Toast.Portal` → `Viewport` that\n * maps `useToastManager().toasts` to `Toast.Root`s, then call\n * `useToastManager().add({ title, description })` to show one. Use a toast for\n * confirmation of a background action; for a choice the user must make, use\n * `Dialog`.\n */\nexport const Toast = {\n Provider,\n Portal,\n Viewport,\n Root,\n Content,\n Title,\n Description,\n Close,\n Action,\n useToastManager,\n createToastManager,\n};\n"],"mappings":";;;;;AAYA,IAAM,IAAW,EAAU,UACrB,IAAS,EAAU,QACnB,IAAS,EAAU,QAGnB,IAAkB,EAAU,iBAC5B,IAAqB,EAAU;AAErC,SAAS,EAAS,EAChB,WAAA,GACA,GAAG,EAAA,GACsC;AACzC,SACE,gBAAA,EAAC,EAAU,UAAX;AAAA,IACE,WAAW,EACT,mGACA,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAK,EAAE,WAAA,GAAW,GAAG,EAAA,GAA6C;AACzE,SACE,gBAAA,EAAC,EAAU,MAAX;AAAA,IACE,WAAW,EAGT,+HACA,kHACA,0EACA,sEACA,6BACA,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAQ,EACf,WAAA,GACA,GAAG,EAAA,GACqC;AACxC,SACE,gBAAA,EAAC,EAAU,SAAX;AAAA,IACE,WAAW,EAAG,iCAAiC,CAAS;AAAA,IACxD,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAM,EAAE,WAAA,GAAW,GAAG,EAAA,GAA8C;AAC3E,SACE,gBAAA,EAAC,EAAU,OAAX;AAAA,IACE,WAAW,EAAG,0CAA0C,CAAS;AAAA,IACjE,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAY,EACnB,WAAA,GACA,GAAG,EAAA,GACyC;AAC5C,SACE,gBAAA,EAAC,EAAU,aAAX;AAAA,IACE,WAAW,EAAG,kCAAkC,CAAS;AAAA,IACzD,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAM,EAAE,WAAA,GAAW,GAAG,EAAA,GAA8C;AAC3E,SACE,gBAAA,EAAC,EAAU,OAAX;AAAA,IACE,WAAW,EACT,+OACA,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AAUA,IAAa,IAAQ;AAAA,EACnB,UAAA;AAAA,EACA,QAAA;AAAA,EACA,UAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA,OAAA;AAAA,EACA,aAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,iBAAA;AAAA,EACA,oBAAA;AACF"}
package/dist/index.js CHANGED
@@ -1,61 +1,73 @@
1
1
  "use client";
2
2
  import { t as s } from "./chunks/cn-DTiB6ek_.js";
3
- import { n as o, r as E, t as _ } from "./chunks/link-provider-9TFNyDqO.js";
4
- import { t as S } from "./chunks/resolve-variant-CcD8iG5l.js";
5
- import { n as I, r as T, t as i } from "./chunks/use-press-pulse-8iorQPsh.js";
3
+ import { n as r, r as o, t as E } from "./chunks/link-provider-9TFNyDqO.js";
4
+ import { t as i } from "./chunks/resolve-variant-CcD8iG5l.js";
5
+ import { n as I, r as n, t as A } from "./chunks/use-press-pulse-8iorQPsh.js";
6
6
  import "./utils.js";
7
- import { a as B, c as e, d as R, f as C, i as O, l as f, n as p, o as P, r as u, s as D, t as N, u as L } from "./chunks/close-button-B8gF5UNk.js";
8
- import { a as U, i as c, n as G, o as l, r as M, s as d, t as g } from "./chunks/basic-page-awtvmT-6.js";
9
- import { a as W, c as F, i as Z, n as b, o as v, r as H, s as w, t as x } from "./chunks/sidebar-DLYTxo2j.js";
10
- import { t as h } from "./chunks/input-CxS7ndpb.js";
11
- import { t as q } from "./chunks/input-group-D6dlma8k.js";
12
- import { n as z, t as J } from "./chunks/card-9cGnv-VD.js";
13
- import { n as Q, t as X } from "./chunks/dialog--PQoodig.js";
14
- import { i as aa, n as sa, r as ta, t as oa } from "./chunks/status-view-CcbctPqR.js";
7
+ import { a as e, c as R, d as p, i as B, l as C, n as O, o as P, r as f, s as u, t as D, u as N } from "./chunks/button-X5wsWvRa.js";
8
+ import { a as c, c as l, i as V, l as U, n as G, o as d, r as M, s as b, t as g } from "./chunks/error-DR6G2LmG.js";
9
+ import { a as F, i as W, n as h, o as Z, r as v, s as w, t as x } from "./chunks/basic-page-D1zm81YS.js";
10
+ import { a as z, c as Y, i as j, n as q, o as y, r as J, s as K, t as Q } from "./chunks/sidebar-DDJC1MeD.js";
11
+ import { t as $ } from "./chunks/input-D3XQcC4J.js";
12
+ import { t as sa } from "./chunks/close-button-xadxp0j8.js";
13
+ import { t as ra } from "./chunks/input-group-D6dlma8k.js";
14
+ import { n as Ea, t as _a } from "./chunks/card-9cGnv-VD.js";
15
+ import { n as Sa, t as Ia } from "./chunks/dialog-Caze1vkf.js";
16
+ import { i as Aa, n as Ta, r as ma, t as ea } from "./chunks/status-view-CcbctPqR.js";
17
+ import "./components/status-view.js";
15
18
  export {
16
- g as BASIC_PAGE_CALLOUT,
17
- G as BASIC_PAGE_CARD,
18
- M as BASIC_PAGE_ITEM,
19
- c as BASIC_PAGE_ITEM_PANEL,
20
- U as BASIC_PAGE_ITEM_PANEL_DIVIDED,
21
- l as BASIC_PAGE_ROW,
22
- p as BUTTON_COLORS,
23
- u as BUTTON_SHAPES,
24
- O as BUTTON_SIZES,
19
+ x as BASIC_PAGE_CALLOUT,
20
+ h as BASIC_PAGE_CARD,
21
+ v as BASIC_PAGE_ITEM,
22
+ W as BASIC_PAGE_ITEM_PANEL,
23
+ F as BASIC_PAGE_ITEM_PANEL_DIVIDED,
24
+ Z as BASIC_PAGE_ROW,
25
+ D as BUTTON_COLORS,
26
+ O as BUTTON_SHAPES,
27
+ f as BUTTON_SIZES,
25
28
  B as BUTTON_VARIANTS,
26
- d as BasicPage,
27
- P as Button,
28
- D as ButtonLink,
29
- J as CARD_SURFACE,
30
- i as CONTROL_PRESS_SCALE,
29
+ w as BasicPage,
30
+ e as Button,
31
+ P as ButtonLink,
32
+ _a as CARD_SURFACE,
33
+ A as CONTROL_PRESS_SCALE,
31
34
  I as CONTROL_PRESS_SPRING,
32
- z as Card,
33
- N as CloseButton,
34
- X as Dialog,
35
- e as EFFECT_BUTTON_SIZES,
36
- f as EffectButton,
37
- L as EffectButtonLink,
38
- h as Input,
39
- q as InputGroup,
40
- _ as LinkProvider,
41
- x as SIDEBAR_HEADER_INSET,
42
- b as SIDEBAR_ITEM,
43
- H as SIDEBAR_ITEM_ACTIVE,
44
- Z as SIDEBAR_ITEM_INACTIVE,
45
- W as SIDEBAR_ROOT,
46
- v as SIDEBAR_ROOT_BASE,
47
- w as SIDEBAR_ROOT_INSET,
48
- oa as STATUS_VIEW,
49
- sa as STATUS_VIEW_COPY,
50
- ta as STATUS_VIEW_SIZES,
51
- F as Sidebar,
52
- aa as StatusView,
53
- R as buttonVariants,
35
+ Ea as Card,
36
+ sa as CloseButton,
37
+ Ia as Dialog,
38
+ u as EFFECT_BUTTON_SIZES,
39
+ R as EffectButton,
40
+ C as EffectButtonLink,
41
+ g as Error,
42
+ G as ErrorView,
43
+ M as GENERIC_ERROR_TITLE,
44
+ $ as Input,
45
+ ra as InputGroup,
46
+ E as LinkProvider,
47
+ Q as SIDEBAR_HEADER_INSET,
48
+ q as SIDEBAR_ITEM,
49
+ J as SIDEBAR_ITEM_ACTIVE,
50
+ j as SIDEBAR_ITEM_INACTIVE,
51
+ z as SIDEBAR_ROOT,
52
+ y as SIDEBAR_ROOT_BASE,
53
+ K as SIDEBAR_ROOT_INSET,
54
+ ea as STATUS_VIEW,
55
+ Ta as STATUS_VIEW_COPY,
56
+ ma as STATUS_VIEW_SIZES,
57
+ Y as Sidebar,
58
+ Aa as StatusView,
59
+ N as buttonVariants,
60
+ V as capitalizeFirst,
54
61
  s as cn,
55
- C as effectButtonVariants,
56
- E as isReactComponent,
57
- S as resolveVariant,
58
- Q as useDialogPending,
59
- o as useLinkComponent,
60
- T as usePressPulse
62
+ c as describeError,
63
+ p as effectButtonVariants,
64
+ d as httpReasonPhrase,
65
+ b as httpStatusExplanation,
66
+ l as isProblem,
67
+ o as isReactComponent,
68
+ U as parseProblem,
69
+ i as resolveVariant,
70
+ Sa as useDialogPending,
71
+ r as useLinkComponent,
72
+ n as usePressPulse
61
73
  };
@@ -43,6 +43,7 @@ import "./primitives/tooltip.js";
43
43
  export * from "@base-ui/react/field";
44
44
  export * from "@base-ui/react/separator";
45
45
  export * from "@base-ui/react/dialog";
46
+ export * from "@base-ui/react/popover";
46
47
  export * from "@base-ui/react/avatar";
47
48
  export * from "@base-ui/react/accordion";
48
49
  export * from "@base-ui/react/alert-dialog";
@@ -65,7 +66,6 @@ export * from "@base-ui/react/meter";
65
66
  export * from "@base-ui/react/navigation-menu";
66
67
  export * from "@base-ui/react/number-field";
67
68
  export * from "@base-ui/react/otp-field";
68
- export * from "@base-ui/react/popover";
69
69
  export * from "@base-ui/react/preview-card";
70
70
  export * from "@base-ui/react/progress";
71
71
  export * from "@base-ui/react/radio";
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { a as _, i as E, n as I, o as a, r as s, s as P, t as C } from "../chunks/basic-page-awtvmT-6.js";
2
+ import { a as _, i as E, n as I, o as a, r as s, s as P, t as C } from "../chunks/basic-page-D1zm81YS.js";
3
3
  export {
4
4
  C as BASIC_PAGE_CALLOUT,
5
5
  I as BASIC_PAGE_CARD,
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { a as I, c as _, i as A, n as R, o as S, r as a, s, t as T } from "../chunks/sidebar-DLYTxo2j.js";
2
+ import { a as I, c as _, i as A, n as R, o as S, r as a, s, t as T } from "../chunks/sidebar-DDJC1MeD.js";
3
3
  export {
4
4
  T as SIDEBAR_HEADER_INSET,
5
5
  R as SIDEBAR_ITEM,
@@ -144,16 +144,24 @@ interface FullscreenContentProps extends Omit<StyledProps<typeof BaseDialog.Popu
144
144
  * @default true
145
145
  */
146
146
  showClose?: boolean;
147
+ /**
148
+ * Classes on the viewport-centering frame (the `min-h-full` flex host).
149
+ * Use to drop the default optical `pb-20` when the stack grows (e.g. a
150
+ * captcha) so true center stays put: `frameClassName="pb-6"`.
151
+ */
152
+ frameClassName?: string;
147
153
  children?: ReactNode;
148
154
  }
149
155
  /**
150
156
  * Convenience full-screen panel: the whole viewport becomes the dialog, with
151
157
  * a centered column at the standalone-flow width (28rem — the same measure as
152
- * onboarding / invite cards). Use for gates the visitor must deal with before
153
- * the page behind makes sense (e.g. binding a phone number); prefer `Content`
154
- * for everything conversational.
158
+ * onboarding / invite cards). Column height follows its content through
159
+ * `AnimatedHeight` (same spring as the Card shell), so step swaps — phone →
160
+ * OTP → captcha — glide instead of jumping. Use for gates the visitor must
161
+ * deal with before the page behind makes sense (e.g. binding a phone number);
162
+ * prefer `Content` for everything conversational.
155
163
  */
156
- declare function FullscreenContent({ icon, title, description, actions, showClose, children, className, ...props }: FullscreenContentProps): import("react").JSX.Element;
164
+ declare function FullscreenContent({ icon, title, description, actions, showClose, frameClassName, children, className, ...props }: FullscreenContentProps): import("react").JSX.Element;
157
165
  /**
158
166
  * Modal dialog built on Base UI `Dialog`. Controlled or uncontrolled via
159
167
  * `Dialog.Root` (`open` / `onOpenChange` / `defaultOpen`). `Dialog.Action`
@@ -13,8 +13,8 @@ declare function Description({ className, ...props }: StyledProps<typeof BaseDra
13
13
  /**
14
14
  * Drawer built on Base UI `Drawer` — a panel that slides in from the edge
15
15
  * (here, the right) with swipe-to-dismiss. Use it for secondary tasks and
16
- * navigation that should keep page context; for a forced decision use
17
- * `AlertDialog`, and for a centered modal use `Dialog`. Compose `Drawer.Portal`
16
+ * navigation that should keep page context; for a decision or a centered modal
17
+ * use `Dialog`. Compose `Drawer.Portal`
18
18
  * → `Backdrop` → `Viewport` → `Popup` → `Content`.
19
19
  */
20
20
  export declare const Drawer: {
@@ -0,0 +1,56 @@
1
+ import { ComponentProps, ReactNode } from 'react';
2
+ import { StatusViewSize } from '../status-view/status-view';
3
+ interface ErrorBaseProps {
4
+ /** The caught value — a problem body, an `Error` wrapping one, or unknown. */
5
+ error?: unknown;
6
+ /** Override the derived message. */
7
+ children?: ReactNode;
8
+ }
9
+ export interface ErrorProps extends ErrorBaseProps, Omit<ComponentProps<"div">, keyof ErrorBaseProps> {
10
+ }
11
+ /**
12
+ * Error — one line of red ink naming a server failure (4xx / 5xx), placed
13
+ * inline: under a form, in a card, beside the action that failed. Give it the
14
+ * caught value and it renders the problem's `detail` (falling back to `title`,
15
+ * then to a generic line), plus a docs link when the problem carries one.
16
+ * Renders nothing while `error` is nullish, so it can stay mounted.
17
+ *
18
+ * For a region or page that failed to load, use {@link ErrorView}.
19
+ */
20
+ export declare function Error({ error, children, className, ...props }: ErrorProps): import("react").JSX.Element | null;
21
+ export declare namespace Error {
22
+ var displayName: string;
23
+ }
24
+ interface ErrorViewBaseProps {
25
+ /** The caught value — a problem body, an `Error` wrapping one, or unknown. */
26
+ error?: unknown;
27
+ /** Override the derived title. */
28
+ title?: ReactNode;
29
+ /** Override the derived description. */
30
+ description?: ReactNode;
31
+ /** Override the warning glyph. */
32
+ icon?: ReactNode;
33
+ /** Offer a retry — renders a "Try again" button. */
34
+ onRetry?: () => void;
35
+ /** Replace the built-in action row entirely. */
36
+ actions?: ReactNode;
37
+ /** Size variant — StatusView's axis. @default "base" */
38
+ size?: StatusViewSize;
39
+ }
40
+ export interface ErrorViewProps extends ErrorViewBaseProps, Omit<ComponentProps<"div">, keyof ErrorViewBaseProps | "children"> {
41
+ }
42
+ /**
43
+ * ErrorView — the failed state of a region or page, built on StatusView:
44
+ * warning icon over the problem's `title`, its `detail` and remediation
45
+ * below, an action row (`onRetry` and the problem's docs link), and the
46
+ * request id as a footnote for support. Announces via `role="alert"`.
47
+ *
48
+ * Use `size="sm"` inside cards and panels, the default `base` for whole
49
+ * pages. Renders nothing while `error` is nullish (unless given a static
50
+ * `title`), so it can sit unconditionally next to a query.
51
+ */
52
+ export declare function ErrorView({ error, title, description, icon, onRetry, actions, size, ...props }: ErrorViewProps): import("react").JSX.Element | null;
53
+ export declare namespace ErrorView {
54
+ var displayName: string;
55
+ }
56
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from './problem';
2
+ export * from './error';
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Client-side mirror of the `@photon-hq/error` response contract — the
3
+ * RFC 9457 Problem Details body every Photon service returns for 4xx / 5xx.
4
+ * Machine logic branches on `code`; `title` / `detail` / `remediation` are
5
+ * the human-readable copy, already reviewed server-side and safe to render.
6
+ *
7
+ * Fetch layers may also hand us a thin status-only shape when the response
8
+ * was not ok but the body was not a contract problem — `title` + `status`
9
+ * still count so the UI can disclose the HTTP code we already know.
10
+ */
11
+ export interface ProblemRemediation {
12
+ /** What the user can do about it — a full sentence. */
13
+ action?: string;
14
+ /** Docs URL explaining the problem. */
15
+ documentation?: string;
16
+ }
17
+ export interface Problem {
18
+ /** Stable machine-readable key (`RATE_LIMITED`) — the field to branch on. */
19
+ code?: string;
20
+ /** Human summary of the problem type ("Too Many Requests"). */
21
+ title: string;
22
+ /** HTTP status (4xx / 5xx). */
23
+ status: number;
24
+ /** Problem type URI (`urn:photon:problem:*` or an https URL). */
25
+ type?: string;
26
+ /** Occurrence-specific human sentence. */
27
+ detail?: string;
28
+ /** Correlation id for support (`X-Request-ID`). */
29
+ requestId?: string;
30
+ remediation?: ProblemRemediation;
31
+ /** RFC 9457 extensions (`issues`, `actualVersion`, …). */
32
+ [extension: string]: unknown;
33
+ }
34
+ /** Structural check: `title` + a 4xx/5xx status. `code` is optional. */
35
+ export declare function isProblem(value: unknown): value is Problem;
36
+ /**
37
+ * Find the problem a caught value carries — the value itself, one typed onto
38
+ * an error as a `problem` field (dashboard's `ApiError` shape), or one
39
+ * wrapped in an `Error` `cause` chain (how fetch layers usually rethrow a
40
+ * parsed body). Returns `null` when there is none.
41
+ */
42
+ export declare function parseProblem(error: unknown): Problem | null;
43
+ export interface ErrorDescription {
44
+ /** Short name of the failure — the problem `title`, or a generic fallback. */
45
+ title: string;
46
+ /** Sentence(s) to show — `detail` and `remediation.action` joined. */
47
+ description?: string;
48
+ /** Docs URL from `remediation.documentation`. */
49
+ documentation?: string;
50
+ /** Correlation id for support. */
51
+ requestId?: string;
52
+ /** The matched problem, when the input carried one. */
53
+ problem?: Problem;
54
+ }
55
+ /**
56
+ * Anything that isn't a problem renders as this — raw `Error` messages are
57
+ * not contract copy and never shown (the same fail-closed stance as the
58
+ * server side of `@photon-hq/error`). Always a full sentence (trailing
59
+ * period).
60
+ */
61
+ export declare const GENERIC_ERROR_TITLE = "Something went wrong.";
62
+ /** Reason phrase for a status — map first, then a non-generic `problem.title`. */
63
+ export declare function httpReasonPhrase(status: number, fallbackTitle?: string): string | undefined;
64
+ /** Human sentence for a bare HTTP status, when the body carried no copy. */
65
+ export declare function httpStatusExplanation(status: number): string;
66
+ /**
67
+ * Sentence-case the first character. Server `detail` / `title` sometimes
68
+ * arrive fully lowercase; UI copy always leads with a capital.
69
+ */
70
+ export declare function capitalizeFirst(text: string): string;
71
+ /**
72
+ * Turn a caught value into displayable copy. `Error` and `ErrorView` call
73
+ * this internally; use it directly for other surfaces (a toast, a banner).
74
+ *
75
+ * Status-only failures (HTTP not ok, but no contract `code` / copy) still
76
+ * keep `problem` so the details panel can show the status. Title becomes the
77
+ * reason phrase (e.g. "Bad Gateway"); description is a short explanation —
78
+ * not just the numeric code.
79
+ */
80
+ export declare function describeError(error: unknown): ErrorDescription;
@@ -65,7 +65,7 @@ export interface NotificationProps extends Omit<HTMLAttributes<HTMLDivElement>,
65
65
  * {@link Toast} — render it as the child of a `Toast.Root` whose own surface you
66
66
  * neutralize (`className="bg-transparent p-0 shadow-none ring-0"`) so the
67
67
  * manager owns motion and swipe while this card owns the look. For a choice the
68
- * user must make, use `AlertDialog` instead.
68
+ * user must make, use `Dialog` instead.
69
69
  */
70
70
  export declare function Notification({ color, title, description, confirmLabel, onConfirm, dismissLabel, onClose, icon, className, ref, ...props }: NotificationProps): import("react").JSX.Element;
71
71
  export declare namespace Notification {
@@ -17,6 +17,12 @@ export interface PhoneInputProps extends Omit<InputHTMLAttributes<HTMLInputEleme
17
17
  defaultCountry?: CountryCode;
18
18
  /** Countries offered in the picker. Defaults to every libphonenumber country. */
19
19
  countries?: CountryCode[];
20
+ /**
21
+ * Pin the calling-code addon — flag + `+N` stay visible, but the country
22
+ * picker is replaced by a static label. Use when the number's region is
23
+ * already known (e.g. confirm-to-destroy flows).
24
+ */
25
+ lockCountry?: boolean;
20
26
  /** Size variant, matching Input / Input Group. @default `"md"` */
21
27
  size?: InputGroupSize;
22
28
  /** Render the invalid state (error ring + error-colored hint). */
@@ -35,7 +41,7 @@ export interface PhoneInputProps extends Omit<InputHTMLAttributes<HTMLInputEleme
35
41
  * Phone number field — country picker (searchable Combobox) + national number
36
42
  * input on a shared Input Group surface. The committed value is always E.164.
37
43
  */
38
- export declare function PhoneInput({ value, defaultValue, onValueChange, defaultCountry, countries: countriesProp, size, invalid, label, hint, labelTrailing, disabled, required, placeholder, className, wrapperClassName, id, ref, "aria-label": ariaLabel, onKeyDown, ...props }: PhoneInputProps): import("react").JSX.Element;
44
+ export declare function PhoneInput({ value, defaultValue, onValueChange, defaultCountry, countries: countriesProp, lockCountry, size, invalid, label, hint, labelTrailing, disabled, required, placeholder, className, wrapperClassName, id, ref, "aria-label": ariaLabel, onKeyDown, ...props }: PhoneInputProps): import("react").JSX.Element;
39
45
  export declare namespace PhoneInput {
40
46
  var displayName: string;
41
47
  }
@@ -16,7 +16,7 @@ declare function Close({ className, ...props }: StyledProps<typeof BaseToast.Clo
16
16
  * maps `useToastManager().toasts` to `Toast.Root`s, then call
17
17
  * `useToastManager().add({ title, description })` to show one. Use a toast for
18
18
  * confirmation of a background action; for a choice the user must make, use
19
- * `AlertDialog`.
19
+ * `Dialog`.
20
20
  */
21
21
  export declare const Toast: {
22
22
  Provider: import('react').FC<import('@base-ui/react').ToastProviderProps>;
@@ -12,5 +12,6 @@ export * from './components/input-group';
12
12
  export * from './components/card';
13
13
  export * from './components/dialog';
14
14
  export * from './components/status-view';
15
+ export * from './components/error';
15
16
  export * from './sections/sidebar';
16
17
  export * from './sections/basic-page';