@photon-ai/pho-ui 4.10.0 → 4.12.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 (58) hide show
  1. package/dist/chunks/animated-height-zr7BmFY1.js +56 -0
  2. package/dist/chunks/animated-height-zr7BmFY1.js.map +1 -0
  3. package/dist/chunks/{bar-chart-HsoFFaPb.js → bar-chart-By5gWQqP.js} +2 -2
  4. package/dist/chunks/{bar-chart-HsoFFaPb.js.map → bar-chart-By5gWQqP.js.map} +1 -1
  5. package/dist/chunks/basic-page-CJ11ekjH.js +2217 -0
  6. package/dist/chunks/basic-page-CJ11ekjH.js.map +1 -0
  7. package/dist/chunks/{chart-BrIXaMue.js → chart-Dx3rjeFn.js} +527 -490
  8. package/dist/chunks/chart-Dx3rjeFn.js.map +1 -0
  9. package/dist/chunks/{chat-B0WIgEyM.js → chat-CU3XVm99.js} +2 -2
  10. package/dist/chunks/{chat-B0WIgEyM.js.map → chat-CU3XVm99.js.map} +1 -1
  11. package/dist/chunks/{checkbox-CLPmblNA.js → checkbox-CwvoEJhd.js} +2 -2
  12. package/dist/chunks/{checkbox-CLPmblNA.js.map → checkbox-CwvoEJhd.js.map} +1 -1
  13. package/dist/chunks/choice-card-_Ocs0iUj.js +17 -0
  14. package/dist/chunks/choice-card-_Ocs0iUj.js.map +1 -0
  15. package/dist/chunks/{command-iYvU6Mhf.js → command-D5g49VqR.js} +3 -3
  16. package/dist/chunks/{command-iYvU6Mhf.js.map → command-D5g49VqR.js.map} +1 -1
  17. package/dist/chunks/{data-table-B1dmrN6r.js → data-table-Ce_c6T73.js} +3 -3
  18. package/dist/chunks/{data-table-B1dmrN6r.js.map → data-table-Ce_c6T73.js.map} +1 -1
  19. package/dist/chunks/{dialog-MPvem7yV.js → dialog-ChS0tdHa.js} +120 -116
  20. package/dist/chunks/dialog-ChS0tdHa.js.map +1 -0
  21. package/dist/chunks/{filter-bar-B-oYYBsU.js → filter-bar-CMkvhvgL.js} +2 -2
  22. package/dist/chunks/{filter-bar-B-oYYBsU.js.map → filter-bar-CMkvhvgL.js.map} +1 -1
  23. package/dist/chunks/{input-DjvZoF8v.js → input-fFWvPJOf.js} +2 -1
  24. package/dist/chunks/{input-DjvZoF8v.js.map → input-fFWvPJOf.js.map} +1 -1
  25. package/dist/chunks/{line-chart-Bv25WyGp.js → line-chart-CAe09fqr.js} +2 -2
  26. package/dist/chunks/{line-chart-Bv25WyGp.js.map → line-chart-CAe09fqr.js.map} +1 -1
  27. package/dist/components/bar-chart.js +1 -1
  28. package/dist/components/chart.js +1 -1
  29. package/dist/components/chat.js +1 -1
  30. package/dist/components/checkbox.js +1 -1
  31. package/dist/components/command.js +1 -1
  32. package/dist/components/data-table.js +1 -1
  33. package/dist/components/dialog.js +1 -1
  34. package/dist/components/field.js +34 -29
  35. package/dist/components/field.js.map +1 -1
  36. package/dist/components/filter-bar.js +1 -1
  37. package/dist/components/input.js +1 -1
  38. package/dist/components/line-chart.js +1 -1
  39. package/dist/components/radio-group.js +64 -59
  40. package/dist/components/radio-group.js.map +1 -1
  41. package/dist/index.js +9 -9
  42. package/dist/sections/basic-page.js +2 -2
  43. package/dist/src/components/dialog/dialog.d.ts +9 -1
  44. package/dist/src/components/field/field.d.ts +11 -1
  45. package/dist/src/components/radio-group/radio-card.d.ts +11 -4
  46. package/dist/src/sections/basic-page/basic-page.d.ts +230 -15
  47. package/dist/src/sections/basic-page/index.d.ts +1 -1
  48. package/dist/src/utils/animated-height.d.ts +16 -7
  49. package/dist/src/utils/choice-card.d.ts +8 -1
  50. package/package.json +1 -1
  51. package/dist/chunks/animated-height-I44sUq0n.js +0 -48
  52. package/dist/chunks/animated-height-I44sUq0n.js.map +0 -1
  53. package/dist/chunks/basic-page-DzT8yecB.js +0 -1801
  54. package/dist/chunks/basic-page-DzT8yecB.js.map +0 -1
  55. package/dist/chunks/chart-BrIXaMue.js.map +0 -1
  56. package/dist/chunks/choice-card-BVNP1NB6.js +0 -17
  57. package/dist/chunks/choice-card-BVNP1NB6.js.map +0 -1
  58. package/dist/chunks/dialog-MPvem7yV.js.map +0 -1
@@ -0,0 +1,56 @@
1
+ "use client";
2
+ import { SPRING_SETTLE as v } from "../motion.js";
3
+ import { useEffect as b, useRef as a } from "react";
4
+ import { jsx as d } from "react/jsx-runtime";
5
+ import { animate as g, motion as S, useMotionValue as z, useReducedMotion as w } from "motion/react";
6
+ var R = v;
7
+ function y(o, r, i, n) {
8
+ const e = z("auto"), s = w();
9
+ return b(() => {
10
+ const c = r.current, l = i.current;
11
+ if (!c || !l) return;
12
+ let t = null;
13
+ const h = new ResizeObserver((p) => {
14
+ const u = p[0]?.borderBoxSize?.[0], f = u ? o === "height" ? u.blockSize : u.inlineSize : o === "height" ? l.offsetHeight : l.offsetWidth, m = e.get();
15
+ if (m === "auto" || s) {
16
+ t?.stop(), t = null, c.style.overflow = "", e.set(f);
17
+ return;
18
+ }
19
+ !t && Math.abs(m - f) < 0.5 || (c.style.overflow = "hidden", t?.stop(), t = g(e, f, {
20
+ ...n,
21
+ onComplete: () => {
22
+ t = null, c.style.overflow = "";
23
+ }
24
+ }));
25
+ });
26
+ return h.observe(l), () => {
27
+ h.disconnect(), t?.stop();
28
+ };
29
+ }, [
30
+ o,
31
+ r,
32
+ i,
33
+ e,
34
+ s,
35
+ n
36
+ ]), e;
37
+ }
38
+ function G({ className: o, transition: r, children: i }) {
39
+ const n = a(null), e = a(null), s = y("height", n, e, r ?? R);
40
+ return /* @__PURE__ */ d(S.div, {
41
+ ref: n,
42
+ className: "min-h-0",
43
+ style: { height: s },
44
+ children: /* @__PURE__ */ d("div", {
45
+ ref: e,
46
+ className: o,
47
+ children: i
48
+ })
49
+ });
50
+ }
51
+ export {
52
+ y as n,
53
+ G as t
54
+ };
55
+
56
+ //# sourceMappingURL=animated-height-zr7BmFY1.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"animated-height-zr7BmFY1.js","names":[],"sources":["../../src/utils/animated-height.tsx"],"sourcesContent":["import { useEffect, useRef, type ReactNode, type RefObject } from \"react\";\nimport { SPRING_SETTLE } from \"../motion\";\nimport {\n animate,\n motion,\n useMotionValue,\n useReducedMotion,\n type MotionValue,\n type ValueAnimationTransition,\n} from \"motion/react\";\n\n/**\n * Height spring for container-size transitions — same feel as the onboarding /\n * invite card and BasicPage footer reveal: quick, critically damped (no\n * overshoot that would flash clipped content).\n */\nconst HEIGHT_SPRING = SPRING_SETTLE;\n\n/**\n * Keeps a container's size on one axis following the measured size of its\n * content on a spring — the core of `AnimatedHeight`, and of any part whose\n * box should glide as its content changes (a paged `Onboard`'s step titles\n * follow their words' width this way). Returns the motion value to put on\n * the container's `style`. Reduced motion snaps it.\n *\n * The container clips only while the spring is in flight. ResizeObserver\n * callbacks run after layout but before paint, so the clip lands before the\n * swap frame can show; once the spring settles it is lifted again, so a focus\n * ring, an effect button's rim, or any other overhang paints normally at\n * rest instead of being cut off at the container's edge.\n */\nexport function useSizeFollow(\n axis: \"height\" | \"width\",\n containerRef: RefObject<HTMLElement | null>,\n contentRef: RefObject<HTMLElement | null>,\n transition: ValueAnimationTransition<number | \"auto\">,\n): MotionValue<number | \"auto\"> {\n const size = useMotionValue<number | \"auto\">(\"auto\");\n const reduceMotion = useReducedMotion();\n\n useEffect(() => {\n const container = containerRef.current;\n const content = contentRef.current;\n if (!container || !content) return;\n\n let animation: ReturnType<typeof animate> | null = null;\n\n const observer = new ResizeObserver((entries) => {\n const box = entries[0]?.borderBoxSize?.[0];\n const next = box\n ? axis === \"height\"\n ? box.blockSize\n : box.inlineSize\n : axis === \"height\"\n ? content.offsetHeight\n : content.offsetWidth;\n const current = size.get();\n if (current === \"auto\" || reduceMotion) {\n animation?.stop();\n animation = null;\n container.style.overflow = \"\";\n size.set(next);\n return;\n }\n if (!animation && Math.abs(current - next) < 0.5) return;\n container.style.overflow = \"hidden\";\n animation?.stop();\n animation = animate(size, next, {\n ...transition,\n // Not fired on stop(), so a retarget can't lift the clip early.\n onComplete: () => {\n animation = null;\n container.style.overflow = \"\";\n },\n });\n });\n observer.observe(content);\n\n return () => {\n observer.disconnect();\n animation?.stop();\n };\n }, [axis, containerRef, contentRef, size, reduceMotion, transition]);\n\n return size;\n}\n\n/**\n * Animates its own height to follow the measured height of `children`, so\n * content swaps (search filtering, skeleton → data) glide instead of jumping.\n * Honors `prefers-reduced-motion` by snapping height with no spring. Clips\n * only while the spring is in flight (see `useSizeFollow`).\n */\nexport function AnimatedHeight({\n className,\n transition,\n children,\n}: {\n className?: string;\n /** Spring override for the height follow. @default the Command spring */\n transition?: ValueAnimationTransition<number | \"auto\">;\n children: ReactNode;\n}) {\n const containerRef = useRef<HTMLDivElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n const height = useSizeFollow(\n \"height\",\n containerRef,\n contentRef,\n transition ?? HEIGHT_SPRING,\n );\n\n return (\n <motion.div\n ref={containerRef}\n // Stack (and other flex parents) set `min-height: auto` on children,\n // which sizes to content and swallows the height spring. Allow\n // shrinking so the measured height can actually animate; the clip is\n // applied imperatively for the spring's duration only (see above).\n className=\"min-h-0\"\n style={{ height }}\n >\n <div ref={contentRef} className={className}>\n {children}\n </div>\n </motion.div>\n );\n}\n"],"mappings":";;;;;AAgBA,IAAM,IAAgB;AAetB,SAAgB,EACd,GACA,GACA,GACA,GAC8B;AAC9B,QAAM,IAAO,EAAgC,MAAM,GAC7C,IAAe,EAAiB;AAEtC,SAAA,EAAA,MAAgB;AACd,UAAM,IAAY,EAAa,SACzB,IAAU,EAAW;AAC3B,QAAI,CAAC,KAAa,CAAC,EAAS;AAE5B,QAAI,IAA+C;AAEnD,UAAM,IAAW,IAAI,eAAA,CAAgB,MAAY;AAC/C,YAAM,IAAM,EAAQ,CAAA,GAAI,gBAAgB,CAAA,GAClC,IAAO,IACT,MAAS,WACP,EAAI,YACJ,EAAI,aACN,MAAS,WACP,EAAQ,eACR,EAAQ,aACR,IAAU,EAAK,IAAI;AACzB,UAAI,MAAY,UAAU,GAAc;AACtC,QAAA,GAAW,KAAK,GAChB,IAAY,MACZ,EAAU,MAAM,WAAW,IAC3B,EAAK,IAAI,CAAI;AACb;AAAA,MACF;AACA,MAAI,CAAC,KAAa,KAAK,IAAI,IAAU,CAAI,IAAI,QAC7C,EAAU,MAAM,WAAW,UAC3B,GAAW,KAAK,GAChB,IAAY,EAAQ,GAAM,GAAM;AAAA,QAC9B,GAAG;AAAA,QAEH,YAAA,MAAkB;AAChB,UAAA,IAAY,MACZ,EAAU,MAAM,WAAW;AAAA,QAC7B;AAAA,MACF,CAAC;AAAA,IACH,CAAC;AACD,WAAA,EAAS,QAAQ,CAAO,GAExB,MAAa;AACX,MAAA,EAAS,WAAW,GACpB,GAAW,KAAK;AAAA,IAClB;AAAA,EACF,GAAG;AAAA,IAAC;AAAA,IAAM;AAAA,IAAc;AAAA,IAAY;AAAA,IAAM;AAAA,IAAc;AAAA,EAAU,CAAC,GAE5D;AACT;AAQA,SAAgB,EAAe,EAC7B,WAAA,GACA,YAAA,GACA,UAAA,EAAA,GAMC;AACD,QAAM,IAAe,EAAuB,IAAI,GAC1C,IAAa,EAAuB,IAAI,GACxC,IAAS,EACb,UACA,GACA,GACA,KAAc,CAChB;AAEA,SACE,gBAAA,EAAC,EAAO,KAAR;AAAA,IACE,KAAK;AAAA,IAKL,WAAU;AAAA,IACV,OAAO,EAAE,QAAA,EAAO;AAAA,IAEhB,UAAA,gBAAA,EAAC,OAAD;AAAA,MAAK,KAAK;AAAA,MAAuB,WAAA;AAAA,MAC9B,UAAA;AAAA,IACE,CAAA;AAAA,EACK,CAAA;AAEhB"}
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { n as o, t as l } from "./chart-BrIXaMue.js";
2
+ import { n as o, t as l } from "./chart-Dx3rjeFn.js";
3
3
  import { jsx as r } from "react/jsx-runtime";
4
4
  function i({ series: t, ...e }) {
5
5
  return /* @__PURE__ */ r(l, {
@@ -16,4 +16,4 @@ export {
16
16
  i as t
17
17
  };
18
18
 
19
- //# sourceMappingURL=bar-chart-HsoFFaPb.js.map
19
+ //# sourceMappingURL=bar-chart-By5gWQqP.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bar-chart-HsoFFaPb.js","names":[],"sources":["../../src/components/bar-chart/bar-chart.tsx"],"sourcesContent":["import { Chart, ChartBar } from \"../chart/chart\";\nimport type { ChartBaseProps, ChartDatum } from \"../chart/types\";\n\n/**\n * BarChart — buckets over time as columns: messages a day, requests an\n * hour, deliveries. One series, several side by side, or `stacked` for\n * parts of a whole (inbound / outbound, successful / failed).\n *\n * A preset on `Chart`: the `series` array becomes one `Chart.Bar` per\n * entry, in order. The marks, axes, tooltip and legend are the root's.\n */\nexport interface BarChartProps<T extends ChartDatum> extends ChartBaseProps<T> {\n /** Stack the series in one column per bucket, first series at the bottom. */\n stacked?: boolean;\n}\n\nexport function BarChart<T extends ChartDatum>({\n series,\n ...props\n}: BarChartProps<T>) {\n return (\n <Chart {...props}>\n {series.map((s) => (\n <ChartBar key={s.key} dataKey={s.key} label={s.label} color={s.color} />\n ))}\n </Chart>\n );\n}\n\nBarChart.displayName = \"BarChart\";\n"],"mappings":";;;AAgBA,SAAgB,EAA+B,EAC7C,QAAA,GACA,GAAG,EAAA,GACgB;AACnB,SACE,gBAAA,EAAC,GAAD;AAAA,IAAO,GAAI;AAAA,IACR,UAAA,EAAO,IAAA,CAAK,MACX,gBAAA,EAAC,GAAD;AAAA,MAAsB,SAAS,EAAE;AAAA,MAAK,OAAO,EAAE;AAAA,MAAO,OAAO,EAAE;AAAA,IAAQ,GAAxD,EAAE,GAAsD,CACxE;AAAA,EACI,CAAA;AAEX;AAEA,EAAS,cAAc"}
1
+ {"version":3,"file":"bar-chart-By5gWQqP.js","names":[],"sources":["../../src/components/bar-chart/bar-chart.tsx"],"sourcesContent":["import { Chart, ChartBar } from \"../chart/chart\";\nimport type { ChartBaseProps, ChartDatum } from \"../chart/types\";\n\n/**\n * BarChart — buckets over time as columns: messages a day, requests an\n * hour, deliveries. One series, several side by side, or `stacked` for\n * parts of a whole (inbound / outbound, successful / failed).\n *\n * A preset on `Chart`: the `series` array becomes one `Chart.Bar` per\n * entry, in order. The marks, axes, tooltip and legend are the root's.\n */\nexport interface BarChartProps<T extends ChartDatum> extends ChartBaseProps<T> {\n /** Stack the series in one column per bucket, first series at the bottom. */\n stacked?: boolean;\n}\n\nexport function BarChart<T extends ChartDatum>({\n series,\n ...props\n}: BarChartProps<T>) {\n return (\n <Chart {...props}>\n {series.map((s) => (\n <ChartBar key={s.key} dataKey={s.key} label={s.label} color={s.color} />\n ))}\n </Chart>\n );\n}\n\nBarChart.displayName = \"BarChart\";\n"],"mappings":";;;AAgBA,SAAgB,EAA+B,EAC7C,QAAA,GACA,GAAG,EAAA,GACgB;AACnB,SACE,gBAAA,EAAC,GAAD;AAAA,IAAO,GAAI;AAAA,IACR,UAAA,EAAO,IAAA,CAAK,MACX,gBAAA,EAAC,GAAD;AAAA,MAAsB,SAAS,EAAE;AAAA,MAAK,OAAO,EAAE;AAAA,MAAO,OAAO,EAAE;AAAA,IAAQ,GAAxD,EAAE,GAAsD,CACxE;AAAA,EACI,CAAA;AAEX;AAEA,EAAS,cAAc"}