@inkeep/cxkit-react 0.0.0-dev-20250311162854 → 0.0.0-dev-20250312233023
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("@inkeep/cxkit-styled"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("@inkeep/cxkit-styled"),x=require("./modal.cjs"),B=require("./embedded-search-and-chat.cjs"),S=require("./embedded-search-and-chat.impl.cjs"),j=require("./embedded-chat.cjs"),b=require("../utils.cjs"),k=require("@radix-ui/react-use-controllable-state");function A(o){const{modalSettings:n,label:s,defaultView:a="chat",canToggleView:r=!0,avatar:i,...l}=o,p={...l,shouldShowAskAICard:r?o.shouldShowAskAICard:!1},{config:c,...u}=S.useWidgetImpl({...p,defaultView:a}),m=h=>{n?.isOpen===void 0&&(o.forceDefaultView&&!h&&u.setView(a??"search"),d(!!h))},[g=!1,d]=k.useControllableState({prop:n?.isOpen,defaultProp:!1,onChange:b.composeEventHandlers(n?.onOpenChange,m)}),I={...n,isOpen:g,onOpenChange:d},f=()=>r?e.jsx(B.InkeepEmbeddedSearchAndChatImpl,{...u}):e.jsx(j.InkeepEmbeddedChatImpl,{...l});return e.jsxs(e.Fragment,{children:[e.jsx(t.Shadow,{wrapperStyles:{display:"contents"},children:e.jsx(t.RootProvider,{config:c,componentType:t.WebWidgetInteractionType.ChatButton,children:e.jsx(C,{label:s,avatar:i,onOpenChange:d})})}),e.jsx(x.InkeepModal,{...c,componentType:t.WebWidgetInteractionType.ChatButton,modalSettings:I,children:f()})]})}function C({label:o="Ask AI",avatar:n,onOpenChange:s}){const a=r=>{r.button!==2&&s(i=>!i)};return e.jsx(t.ChatButton.Container,{children:e.jsxs(t.ChatButton.ChatButton,{onClick:a,children:[e.jsx(t.ChatButton.ChatButtonText,{children:o}),e.jsx(t.ChatButton.ChatButtonAvatarContent,{children:e.jsx(t.ChatButton.ChatButtonAvatarImage,{avatar:n})})]})})}exports.ChatButtonImpl=C;exports.InkeepChatButton=A;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as u, Fragment as
|
|
3
|
-
import { Shadow as
|
|
4
|
-
import { InkeepModal as
|
|
2
|
+
import { jsxs as u, Fragment as A, jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { Shadow as B, RootProvider as S, WebWidgetInteractionType as p, ChatButton as o } from "@inkeep/cxkit-styled";
|
|
4
|
+
import { InkeepModal as w } from "./modal.js";
|
|
5
5
|
import { InkeepEmbeddedSearchAndChatImpl as b } from "./embedded-search-and-chat.js";
|
|
6
6
|
import { useWidgetImpl as v } from "./embedded-search-and-chat.impl.js";
|
|
7
7
|
import { InkeepEmbeddedChatImpl as y } from "./embedded-chat.js";
|
|
8
8
|
import { composeEventHandlers as O } from "../utils.js";
|
|
9
9
|
import { useControllableState as T } from "@radix-ui/react-use-controllable-state";
|
|
10
|
-
function M(
|
|
10
|
+
function M(n) {
|
|
11
11
|
const {
|
|
12
12
|
modalSettings: e,
|
|
13
13
|
label: i,
|
|
14
14
|
defaultView: r = "chat",
|
|
15
15
|
canToggleView: a = !0,
|
|
16
16
|
avatar: l,
|
|
17
|
-
...
|
|
18
|
-
} =
|
|
19
|
-
...
|
|
20
|
-
shouldShowAskAICard: a
|
|
21
|
-
}, { config: c, ...
|
|
22
|
-
e?.isOpen === void 0 && (
|
|
17
|
+
...d
|
|
18
|
+
} = n, C = {
|
|
19
|
+
...d,
|
|
20
|
+
shouldShowAskAICard: a ? n.shouldShowAskAICard : !1
|
|
21
|
+
}, { config: c, ...h } = v({ ...C, defaultView: r }), f = (m) => {
|
|
22
|
+
e?.isOpen === void 0 && (n.forceDefaultView && !m && h.setView(r ?? "search"), s(!!m));
|
|
23
23
|
}, [g = !1, s] = T({
|
|
24
24
|
prop: e?.isOpen,
|
|
25
25
|
defaultProp: !1,
|
|
@@ -28,27 +28,27 @@ function M(o) {
|
|
|
28
28
|
...e,
|
|
29
29
|
isOpen: g,
|
|
30
30
|
onOpenChange: s
|
|
31
|
-
},
|
|
32
|
-
return /* @__PURE__ */ u(
|
|
33
|
-
/* @__PURE__ */ t(
|
|
31
|
+
}, k = () => a ? /* @__PURE__ */ t(b, { ...h }) : /* @__PURE__ */ t(y, { ...d });
|
|
32
|
+
return /* @__PURE__ */ u(A, { children: [
|
|
33
|
+
/* @__PURE__ */ t(B, { wrapperStyles: { display: "contents" }, children: /* @__PURE__ */ t(S, { config: c, componentType: p.ChatButton, children: /* @__PURE__ */ t(x, { label: i, avatar: l, onOpenChange: s }) }) }),
|
|
34
34
|
/* @__PURE__ */ t(
|
|
35
|
-
|
|
35
|
+
w,
|
|
36
36
|
{
|
|
37
37
|
...c,
|
|
38
|
-
componentType:
|
|
38
|
+
componentType: p.ChatButton,
|
|
39
39
|
modalSettings: I,
|
|
40
|
-
children:
|
|
40
|
+
children: k()
|
|
41
41
|
}
|
|
42
42
|
)
|
|
43
43
|
] });
|
|
44
44
|
}
|
|
45
|
-
function x({ label:
|
|
45
|
+
function x({ label: n = "Ask AI", avatar: e, onOpenChange: i }) {
|
|
46
46
|
const r = (a) => {
|
|
47
47
|
a.button !== 2 && i((l) => !l);
|
|
48
48
|
};
|
|
49
|
-
return /* @__PURE__ */ t(
|
|
50
|
-
/* @__PURE__ */ t(
|
|
51
|
-
/* @__PURE__ */ t(
|
|
49
|
+
return /* @__PURE__ */ t(o.Container, { children: /* @__PURE__ */ u(o.ChatButton, { onClick: r, children: [
|
|
50
|
+
/* @__PURE__ */ t(o.ChatButtonText, { children: n }),
|
|
51
|
+
/* @__PURE__ */ t(o.ChatButtonAvatarContent, { children: /* @__PURE__ */ t(o.ChatButtonAvatarImage, { avatar: e }) })
|
|
52
52
|
] }) });
|
|
53
53
|
}
|
|
54
54
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),x=require("./embedded-search-and-chat.cjs"),j=require("./embedded-search-and-chat.impl.cjs"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),x=require("./embedded-search-and-chat.cjs"),j=require("./embedded-search-and-chat.impl.cjs"),f=require("./embedded-search.cjs"),r=require("@inkeep/cxkit-styled"),C=require("./modal.cjs"),b=require("../utils.cjs"),g=require("@radix-ui/react-use-controllable-state");function y(a){const{modalSettings:t,defaultView:n="search",canToggleView:c=!0,...o}=a,h={...o,shouldShowAskAICard:c?a.shouldShowAskAICard:!1},{config:i,...d}=j.useWidgetImpl({...h,defaultView:n}),p=S=>{t?.isOpen===void 0&&(a.forceDefaultView&&!S&&d.setView(n),s(!!S))},[B=!1,s]=g.useControllableState({prop:t?.isOpen,defaultProp:!1,onChange:b.composeEventHandlers(t?.onOpenChange,p)}),l={shortcutKey:"k",...t,isOpen:B,onOpenChange:s},m=()=>c?e.jsx(x.InkeepEmbeddedSearchAndChatImpl,{...d}):e.jsx(f.InkeepEmbeddedSearchImpl,{...h});return e.jsxs(e.Fragment,{children:[e.jsx(r.Shadow,{wrapperStyles:{display:"contents"},children:e.jsx(r.RootProvider,{config:i,componentType:r.WebWidgetInteractionType.SearchBar,children:e.jsx(u,{onOpenChange:s,modalSettings:l})})}),e.jsx(C.InkeepModal,{...i,modalSettings:l,componentType:r.WebWidgetInteractionType.SearchBar,children:m()})]})}function u({onOpenChange:a,modalSettings:t}){const n=c=>{c.button!==2&&a(o=>!o)};return e.jsx(r.SearchBar.SearchBarContainer,{children:e.jsxs(r.SearchBar.SearchBarButton,{onClick:n,children:[e.jsxs(r.SearchBar.SearchBarContentWrapper,{children:[e.jsx(r.SearchBar.SearchBarIcon,{}),e.jsx(r.SearchBar.SearchBarText,{})]}),e.jsxs(r.SearchBar.SearchBarKbdWrapper,{children:[e.jsx(r.SearchBar.SearchBarKbdModifier,{shortcutKey:t?.shortcutKey}),e.jsx(r.SearchBar.SearchBarKbdShortcutKey,{shortcutKey:t?.shortcutKey})]})]})})}exports.InkeepSearchBar=y;exports.SearchBarImpl=u;
|
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as c, Fragment as
|
|
3
|
-
import { InkeepEmbeddedSearchAndChatImpl as
|
|
4
|
-
import { useWidgetImpl as
|
|
5
|
-
import { InkeepEmbeddedSearchImpl as
|
|
6
|
-
import { Shadow as
|
|
7
|
-
import { InkeepModal as
|
|
2
|
+
import { jsxs as c, Fragment as C, jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { InkeepEmbeddedSearchAndChatImpl as g } from "./embedded-search-and-chat.js";
|
|
4
|
+
import { useWidgetImpl as I } from "./embedded-search-and-chat.impl.js";
|
|
5
|
+
import { InkeepEmbeddedSearchImpl as y } from "./embedded-search.js";
|
|
6
|
+
import { Shadow as k, RootProvider as K, WebWidgetInteractionType as u, SearchBar as r } from "@inkeep/cxkit-styled";
|
|
7
|
+
import { InkeepModal as b } from "./modal.js";
|
|
8
8
|
import { composeEventHandlers as w } from "../utils.js";
|
|
9
|
-
import { useControllableState as
|
|
9
|
+
import { useControllableState as A } from "@radix-ui/react-use-controllable-state";
|
|
10
10
|
function M(n) {
|
|
11
11
|
const {
|
|
12
12
|
modalSettings: t,
|
|
13
13
|
defaultView: o = "search",
|
|
14
14
|
canToggleView: a = !0,
|
|
15
15
|
...i
|
|
16
|
-
} = n,
|
|
16
|
+
} = n, s = {
|
|
17
17
|
...i,
|
|
18
|
-
shouldShowAskAICard: a
|
|
19
|
-
}, { config:
|
|
20
|
-
...
|
|
18
|
+
shouldShowAskAICard: a ? n.shouldShowAskAICard : !1
|
|
19
|
+
}, { config: d, ...l } = I({
|
|
20
|
+
...s,
|
|
21
21
|
defaultView: o
|
|
22
22
|
}), f = (m) => {
|
|
23
|
-
t?.isOpen === void 0 && (n.forceDefaultView && !m &&
|
|
24
|
-
}, [S = !1, h] =
|
|
23
|
+
t?.isOpen === void 0 && (n.forceDefaultView && !m && l.setView(o), h(!!m));
|
|
24
|
+
}, [S = !1, h] = A({
|
|
25
25
|
prop: t?.isOpen,
|
|
26
26
|
defaultProp: !1,
|
|
27
27
|
onChange: w(t?.onOpenChange, f)
|
|
28
|
-
}),
|
|
28
|
+
}), p = {
|
|
29
29
|
shortcutKey: "k",
|
|
30
30
|
...t,
|
|
31
31
|
isOpen: S,
|
|
32
32
|
onOpenChange: h
|
|
33
|
-
}, B = () => a ? /* @__PURE__ */ e(
|
|
34
|
-
return /* @__PURE__ */ c(
|
|
35
|
-
/* @__PURE__ */ e(
|
|
33
|
+
}, B = () => a ? /* @__PURE__ */ e(g, { ...l }) : /* @__PURE__ */ e(y, { ...s });
|
|
34
|
+
return /* @__PURE__ */ c(C, { children: [
|
|
35
|
+
/* @__PURE__ */ e(k, { wrapperStyles: { display: "contents" }, children: /* @__PURE__ */ e(K, { config: d, componentType: u.SearchBar, children: /* @__PURE__ */ e(O, { onOpenChange: h, modalSettings: p }) }) }),
|
|
36
36
|
/* @__PURE__ */ e(
|
|
37
|
-
|
|
37
|
+
b,
|
|
38
38
|
{
|
|
39
|
-
...
|
|
40
|
-
modalSettings:
|
|
39
|
+
...d,
|
|
40
|
+
modalSettings: p,
|
|
41
41
|
componentType: u.SearchBar,
|
|
42
42
|
children: B()
|
|
43
43
|
}
|
|
44
44
|
)
|
|
45
45
|
] });
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function O({ onOpenChange: n, modalSettings: t }) {
|
|
48
48
|
const o = (a) => {
|
|
49
49
|
a.button !== 2 && n((i) => !i);
|
|
50
50
|
};
|
|
@@ -61,5 +61,5 @@ function T({ onOpenChange: n, modalSettings: t }) {
|
|
|
61
61
|
}
|
|
62
62
|
export {
|
|
63
63
|
M as InkeepSearchBar,
|
|
64
|
-
|
|
64
|
+
O as SearchBarImpl
|
|
65
65
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/cxkit-react",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20250312233023",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Inkeep, Inc. Customer License (IICL) v1.1",
|
|
6
6
|
"homepage": "",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"sideEffects": false,
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@radix-ui/react-use-controllable-state": "^1.1.0",
|
|
24
|
-
"@inkeep/cxkit-styled": "0.0.0-dev-
|
|
24
|
+
"@inkeep/cxkit-styled": "0.0.0-dev-20250312233023"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@biomejs/biome": "1.9.4",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"typescript": "5.7.3",
|
|
45
45
|
"vite": "5.4.11",
|
|
46
46
|
"vite-plugin-dts": "4.4.0",
|
|
47
|
-
"@inkeep/cxkit-color-mode": "0.0.0-dev-
|
|
48
|
-
"@inkeep/cxkit-types": "0.0.0-dev-
|
|
47
|
+
"@inkeep/cxkit-color-mode": "0.0.0-dev-20250312233023",
|
|
48
|
+
"@inkeep/cxkit-types": "0.0.0-dev-20250312233023"
|
|
49
49
|
},
|
|
50
50
|
"module": "dist/index.js",
|
|
51
51
|
"types": "dist/index.d.ts",
|