@photon-ai/pho-ui 4.3.0 → 4.4.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/animated-height-I44sUq0n.js +48 -0
- package/dist/chunks/animated-height-I44sUq0n.js.map +1 -0
- package/dist/chunks/{basic-page-65eFgq8o.js → basic-page-ijv-ijUB.js} +534 -519
- package/dist/chunks/basic-page-ijv-ijUB.js.map +1 -0
- package/dist/chunks/bubble-eaoLJP4N.js +88 -0
- package/dist/chunks/bubble-eaoLJP4N.js.map +1 -0
- package/dist/chunks/{button-CdqS_t5a.js → button-CgUS0j3D.js} +4 -4
- package/dist/chunks/button-CgUS0j3D.js.map +1 -0
- package/dist/chunks/chat-DUqWlXqt.js +619 -0
- package/dist/chunks/chat-DUqWlXqt.js.map +1 -0
- package/dist/chunks/{code-block-BuDIo8Q0.js → code-block-BGgbp-6Q.js} +12 -12
- package/dist/chunks/{code-block-BuDIo8Q0.js.map → code-block-BGgbp-6Q.js.map} +1 -1
- package/dist/chunks/collapsible-Dv306QOT.js +40 -0
- package/dist/chunks/collapsible-Dv306QOT.js.map +1 -0
- package/dist/chunks/command-BfCCRaoc.js +225 -0
- package/dist/chunks/command-BfCCRaoc.js.map +1 -0
- package/dist/chunks/{copy-button-B_B15mEi.js → copy-button-D8XyP0oR.js} +10 -10
- package/dist/chunks/copy-button-D8XyP0oR.js.map +1 -0
- package/dist/chunks/{data-table-BeUwsjmX.js → data-table-Mog6m3d9.js} +2 -2
- package/dist/chunks/{data-table-BeUwsjmX.js.map → data-table-Mog6m3d9.js.map} +1 -1
- package/dist/chunks/{description-list-C-mwe4ki.js → description-list-8qm83WZB.js} +17 -17
- package/dist/chunks/description-list-8qm83WZB.js.map +1 -0
- package/dist/chunks/{dialog-BYiAFetB.js → dialog-DeM4axJ6.js} +47 -51
- package/dist/chunks/{dialog-BYiAFetB.js.map → dialog-DeM4axJ6.js.map} +1 -1
- package/dist/chunks/{error-BAQgnde7.js → error-VvHnteyf.js} +2 -2
- package/dist/chunks/{error-BAQgnde7.js.map → error-VvHnteyf.js.map} +1 -1
- package/dist/chunks/{filter-bar-DTaLgQr0.js → filter-bar-BcpeTKCC.js} +38 -36
- package/dist/chunks/filter-bar-BcpeTKCC.js.map +1 -0
- package/dist/chunks/{log-list-BERiO4UJ.js → log-list-Didt-MV4.js} +2 -2
- package/dist/chunks/{log-list-BERiO4UJ.js.map → log-list-Didt-MV4.js.map} +1 -1
- package/dist/chunks/message-CTml-TrB.js +89 -0
- package/dist/chunks/message-CTml-TrB.js.map +1 -0
- package/dist/chunks/{scroll-area-Zik8t1Mk.js → scroll-area-DSwD9th7.js} +2 -2
- package/dist/chunks/{scroll-area-Zik8t1Mk.js.map → scroll-area-DSwD9th7.js.map} +1 -1
- package/dist/chunks/{sidebar-DRPe5CAh.js → sidebar-BmloUwJQ.js} +57 -57
- package/dist/chunks/sidebar-BmloUwJQ.js.map +1 -0
- package/dist/chunks/{toast-72Wwlzg9.js → toast-DUvjSZF7.js} +3 -3
- package/dist/chunks/{toast-72Wwlzg9.js.map → toast-DUvjSZF7.js.map} +1 -1
- package/dist/chunks/{trace-Hku-rImp.js → trace-CjOi3_IP.js} +2 -2
- package/dist/chunks/{trace-Hku-rImp.js.map → trace-CjOi3_IP.js.map} +1 -1
- package/dist/components/accordion.js +3 -3
- package/dist/components/accordion.js.map +1 -1
- package/dist/components/bubble.js +6 -0
- package/dist/components/button.js +1 -1
- package/dist/components/chat.js +5 -0
- package/dist/components/code-block.js +1 -1
- package/dist/components/collapsible.js +1 -1
- package/dist/components/command.js +1 -1
- package/dist/components/copy-button.js +1 -1
- package/dist/components/data-table.js +1 -1
- package/dist/components/description-list.js +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/error.js +1 -1
- package/dist/components/filter-bar.js +1 -1
- package/dist/components/log-list.js +1 -1
- package/dist/components/message.js +7 -0
- package/dist/components/scroll-area.js +1 -1
- package/dist/components/toast.js +1 -1
- package/dist/components/trace.js +1 -1
- package/dist/index.js +145 -136
- package/dist/sections/basic-page.js +2 -2
- package/dist/sections/sidebar.js +1 -1
- package/dist/src/components/bubble/bubble.d.ts +112 -0
- package/dist/src/components/bubble/index.d.ts +1 -0
- package/dist/src/components/chat/chat.d.ts +301 -0
- package/dist/src/components/chat/index.d.ts +1 -0
- package/dist/src/components/collapsible/collapsible.d.ts +1 -1
- package/dist/src/components/command/command.d.ts +14 -4
- package/dist/src/components/command/index.d.ts +1 -1
- package/dist/src/components/filter-bar/filter-bar.d.ts +5 -0
- package/dist/src/components/message/index.d.ts +2 -0
- package/dist/src/components/message/message-status.d.ts +22 -0
- package/dist/src/components/message/message.d.ts +78 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/sections/sidebar/sidebar.d.ts +10 -1
- package/dist/src/utils/animated-height.d.ts +6 -0
- package/package.json +13 -1
- package/dist/chunks/animated-height-CCO-Ocoz.js +0 -48
- package/dist/chunks/animated-height-CCO-Ocoz.js.map +0 -1
- package/dist/chunks/basic-page-65eFgq8o.js.map +0 -1
- package/dist/chunks/button-CdqS_t5a.js.map +0 -1
- package/dist/chunks/collapsible-if7ncPbI.js +0 -28
- package/dist/chunks/collapsible-if7ncPbI.js.map +0 -1
- package/dist/chunks/command-ZagVyDx7.js +0 -192
- package/dist/chunks/command-ZagVyDx7.js.map +0 -1
- package/dist/chunks/copy-button-B_B15mEi.js.map +0 -1
- package/dist/chunks/description-list-C-mwe4ki.js.map +0 -1
- package/dist/chunks/filter-bar-DTaLgQr0.js.map +0 -1
- package/dist/chunks/sidebar-DRPe5CAh.js.map +0 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { SPRING_SETTLE as b } from "../motion.js";
|
|
3
|
+
import { useEffect as R, useRef as m } from "react";
|
|
4
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
5
|
+
import { animate as x, motion as S, useMotionValue as g, useReducedMotion as w } from "motion/react";
|
|
6
|
+
var y = b;
|
|
7
|
+
function G({ className: p, transition: s, children: v }) {
|
|
8
|
+
const i = m(null), c = m(null), t = g("auto"), l = w();
|
|
9
|
+
return R(() => {
|
|
10
|
+
const o = i.current, n = c.current;
|
|
11
|
+
if (!o || !n) return;
|
|
12
|
+
let e = null;
|
|
13
|
+
const u = new ResizeObserver((h) => {
|
|
14
|
+
const f = h[0]?.borderBoxSize?.[0], r = f ? f.blockSize : n.offsetHeight, a = t.get();
|
|
15
|
+
if (a === "auto" || l) {
|
|
16
|
+
e?.stop(), e = null, o.style.overflow = "", t.set(r);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
!e && Math.abs(a - r) < 0.5 || (o.style.overflow = "hidden", e?.stop(), e = x(t, r, {
|
|
20
|
+
...s ?? y,
|
|
21
|
+
onComplete: () => {
|
|
22
|
+
e = null, o.style.overflow = "";
|
|
23
|
+
}
|
|
24
|
+
}));
|
|
25
|
+
});
|
|
26
|
+
return u.observe(n), () => {
|
|
27
|
+
u.disconnect(), e?.stop();
|
|
28
|
+
};
|
|
29
|
+
}, [
|
|
30
|
+
t,
|
|
31
|
+
l,
|
|
32
|
+
s
|
|
33
|
+
]), /* @__PURE__ */ d(S.div, {
|
|
34
|
+
ref: i,
|
|
35
|
+
className: "min-h-0",
|
|
36
|
+
style: { height: t },
|
|
37
|
+
children: /* @__PURE__ */ d("div", {
|
|
38
|
+
ref: c,
|
|
39
|
+
className: p,
|
|
40
|
+
children: v
|
|
41
|
+
})
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
G as t
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=animated-height-I44sUq0n.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animated-height-I44sUq0n.js","names":[],"sources":["../../src/utils/animated-height.tsx"],"sourcesContent":["import { useEffect, useRef, type ReactNode } from \"react\";\nimport { SPRING_SETTLE } from \"../motion\";\nimport {\n animate,\n motion,\n useMotionValue,\n useReducedMotion,\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 * 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.\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 on the last row paints\n * normally at rest instead of being cut off at the container's edge.\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 = 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 ? box.blockSize : content.offsetHeight;\n const current = height.get();\n if (current === \"auto\" || reduceMotion) {\n animation?.stop();\n animation = null;\n container.style.overflow = \"\";\n height.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(height, next, {\n ...(transition ?? HEIGHT_SPRING),\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 }, [height, reduceMotion, transition]);\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":";;;;;AAeA,IAAM,IAAgB;AAatB,SAAgB,EAAe,EAC7B,WAAA,GACA,YAAA,GACA,UAAA,EAAA,GAMC;AACD,QAAM,IAAe,EAAuB,IAAI,GAC1C,IAAa,EAAuB,IAAI,GACxC,IAAS,EAAgC,MAAM,GAC/C,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,IAAM,EAAI,YAAY,EAAQ,cACrC,IAAU,EAAO,IAAI;AAC3B,UAAI,MAAY,UAAU,GAAc;AACtC,QAAA,GAAW,KAAK,GAChB,IAAY,MACZ,EAAU,MAAM,WAAW,IAC3B,EAAO,IAAI,CAAI;AACf;AAAA,MACF;AACA,MAAI,CAAC,KAAa,KAAK,IAAI,IAAU,CAAI,IAAI,QAC7C,EAAU,MAAM,WAAW,UAC3B,GAAW,KAAK,GAChB,IAAY,EAAQ,GAAQ,GAAM;AAAA,QAChC,GAAI,KAAc;AAAA,QAElB,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,IAAQ;AAAA,IAAc;AAAA,EAAU,CAAC,GAGnC,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"}
|