@inkeep/cxkit-react 0.0.0-dev-20250221234142
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/LICENSE +21 -0
- package/README.md +1 -0
- package/dist/components/chat-button.cjs +1 -0
- package/dist/components/chat-button.d.cts +14 -0
- package/dist/components/chat-button.d.ts +14 -0
- package/dist/components/chat-button.js +54 -0
- package/dist/components/embedded-chat.cjs +1 -0
- package/dist/components/embedded-chat.d.cts +8 -0
- package/dist/components/embedded-chat.d.ts +8 -0
- package/dist/components/embedded-chat.js +340 -0
- package/dist/components/embedded-search-and-chat.cjs +1 -0
- package/dist/components/embedded-search-and-chat.d.cts +40 -0
- package/dist/components/embedded-search-and-chat.d.ts +40 -0
- package/dist/components/embedded-search-and-chat.impl.cjs +1 -0
- package/dist/components/embedded-search-and-chat.impl.d.cts +9 -0
- package/dist/components/embedded-search-and-chat.impl.d.ts +9 -0
- package/dist/components/embedded-search-and-chat.impl.js +43 -0
- package/dist/components/embedded-search-and-chat.js +65 -0
- package/dist/components/embedded-search.cjs +1 -0
- package/dist/components/embedded-search.d.cts +14 -0
- package/dist/components/embedded-search.d.ts +14 -0
- package/dist/components/embedded-search.js +99 -0
- package/dist/components/index.cjs +1 -0
- package/dist/components/index.d.cts +10 -0
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.js +28 -0
- package/dist/components/intelligent-form.cjs +1 -0
- package/dist/components/intelligent-form.d.cts +8 -0
- package/dist/components/intelligent-form.d.ts +8 -0
- package/dist/components/intelligent-form.js +130 -0
- package/dist/components/modal.chat.cjs +1 -0
- package/dist/components/modal.chat.d.cts +6 -0
- package/dist/components/modal.chat.d.ts +6 -0
- package/dist/components/modal.chat.js +21 -0
- package/dist/components/modal.cjs +1 -0
- package/dist/components/modal.d.cts +21 -0
- package/dist/components/modal.d.ts +21 -0
- package/dist/components/modal.js +19 -0
- package/dist/components/modal.search-and-chat.cjs +1 -0
- package/dist/components/modal.search-and-chat.d.cts +6 -0
- package/dist/components/modal.search-and-chat.d.ts +6 -0
- package/dist/components/modal.search-and-chat.js +27 -0
- package/dist/components/modal.search.cjs +1 -0
- package/dist/components/modal.search.d.cts +6 -0
- package/dist/components/modal.search.d.ts +6 -0
- package/dist/components/modal.search.js +21 -0
- package/dist/components/searchbar.cjs +1 -0
- package/dist/components/searchbar.d.cts +13 -0
- package/dist/components/searchbar.d.ts +13 -0
- package/dist/components/searchbar.js +60 -0
- package/dist/components/widget-toggle.cjs +1 -0
- package/dist/components/widget-toggle.d.cts +14 -0
- package/dist/components/widget-toggle.d.ts +14 -0
- package/dist/components/widget-toggle.js +62 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +29 -0
- package/dist/utils.cjs +1 -0
- package/dist/utils.d.cts +6 -0
- package/dist/utils.d.ts +6 -0
- package/dist/utils.js +20 -0
- package/package.json +73 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useRef as r, useState as V, useImperativeHandle as d, useEffect as b } from "react";
|
|
3
|
+
import { composeRefs as a } from "../utils.js";
|
|
4
|
+
function _(f) {
|
|
5
|
+
const {
|
|
6
|
+
defaultView: c = "search",
|
|
7
|
+
aiChatSettings: i,
|
|
8
|
+
baseSettings: g,
|
|
9
|
+
searchSettings: o,
|
|
10
|
+
shouldAutoFocusInput: h = !0,
|
|
11
|
+
onToggleView: l,
|
|
12
|
+
ref: m,
|
|
13
|
+
...S
|
|
14
|
+
} = f, t = r(null), R = a(t, i?.chatFunctionsRef), u = r(null), w = a(u, o?.searchFunctionsRef), p = {
|
|
15
|
+
...i,
|
|
16
|
+
chatFunctionsRef: R
|
|
17
|
+
}, F = {
|
|
18
|
+
...o,
|
|
19
|
+
searchFunctionsRef: w
|
|
20
|
+
}, [n, s] = V(c), I = (e) => {
|
|
21
|
+
e.autoSubmit && e.query && t.current?.submitMessage(e.query), l?.(e), s(e.view);
|
|
22
|
+
};
|
|
23
|
+
return d(m, () => ({
|
|
24
|
+
setView: s
|
|
25
|
+
})), b(() => {
|
|
26
|
+
n === "chat" ? t.current?.focusInput() : u.current?.focusInput();
|
|
27
|
+
}, [n]), {
|
|
28
|
+
config: {
|
|
29
|
+
baseSettings: g,
|
|
30
|
+
aiChatSettings: p,
|
|
31
|
+
searchSettings: F
|
|
32
|
+
},
|
|
33
|
+
defaultView: c,
|
|
34
|
+
view: n,
|
|
35
|
+
setView: s,
|
|
36
|
+
onToggleView: I,
|
|
37
|
+
shouldAutoFocusInput: h,
|
|
38
|
+
...S
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
_ as useWidgetImpl
|
|
43
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as e, jsxs as a } from "react/jsx-runtime";
|
|
3
|
+
import { InkeepEmbeddedChatImpl as p } from "./embedded-chat.js";
|
|
4
|
+
import { Shadow as m, RootProvider as u, WebWidgetInteractionType as l, WidgetProvider as I } from "@inkeep/cxkit-styled";
|
|
5
|
+
import { InkeepEmbeddedSearchImpl as f } from "./embedded-search.js";
|
|
6
|
+
import { useWidgetImpl as w } from "./embedded-search-and-chat.impl.js";
|
|
7
|
+
function E(d) {
|
|
8
|
+
const { config: t, ...i } = w(d);
|
|
9
|
+
return /* @__PURE__ */ e(
|
|
10
|
+
m,
|
|
11
|
+
{
|
|
12
|
+
wrapperStyles: {
|
|
13
|
+
height: "inherit",
|
|
14
|
+
width: "inherit"
|
|
15
|
+
},
|
|
16
|
+
children: /* @__PURE__ */ e(
|
|
17
|
+
u,
|
|
18
|
+
{
|
|
19
|
+
config: t,
|
|
20
|
+
interactionType: l.EmbeddedSearchAndChat,
|
|
21
|
+
children: /* @__PURE__ */ e(A, { ...i })
|
|
22
|
+
}
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
function A(d) {
|
|
28
|
+
const {
|
|
29
|
+
view: t,
|
|
30
|
+
setView: i,
|
|
31
|
+
shouldShowAskAICard: s,
|
|
32
|
+
onToggleView: o,
|
|
33
|
+
defaultView: r,
|
|
34
|
+
shouldAutoFocusInput: n,
|
|
35
|
+
searchLabel: h,
|
|
36
|
+
askAILabel: c
|
|
37
|
+
} = d;
|
|
38
|
+
return /* @__PURE__ */ a(I, { widget: { setView: i }, children: [
|
|
39
|
+
/* @__PURE__ */ e(
|
|
40
|
+
f,
|
|
41
|
+
{
|
|
42
|
+
isHidden: t === "chat",
|
|
43
|
+
onToggleView: o,
|
|
44
|
+
shouldShowAskAICard: s,
|
|
45
|
+
shouldAutoFocusInput: n && r === "search",
|
|
46
|
+
searchLabel: h,
|
|
47
|
+
askAILabel: c
|
|
48
|
+
}
|
|
49
|
+
),
|
|
50
|
+
/* @__PURE__ */ e(
|
|
51
|
+
p,
|
|
52
|
+
{
|
|
53
|
+
isHidden: t === "search",
|
|
54
|
+
onToggleView: o,
|
|
55
|
+
shouldAutoFocusInput: n && r === "chat",
|
|
56
|
+
askAILabel: c,
|
|
57
|
+
searchLabel: h
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
] });
|
|
61
|
+
}
|
|
62
|
+
export {
|
|
63
|
+
E as InkeepEmbeddedSearchAndChat,
|
|
64
|
+
A as InkeepEmbeddedSearchAndChatImpl
|
|
65
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("@inkeep/cxkit-styled"),o=require("react"),a=require("./widget-toggle.cjs");function h(s){const{baseSettings:r,searchSettings:c}=s;return e.jsx(d.Shadow,{children:e.jsx(d.RootProvider,{config:{baseSettings:r,searchSettings:c},interactionType:d.WebWidgetInteractionType.EmbeddedSearch,children:e.jsx(l,{...s})})})}function l(s){const{onToggleView:r,isHidden:c,shouldAutoFocusInput:t=!r}=s,n=d.useModal();return e.jsx(d.EmbeddedSearch.Provider,{isHidden:c,shouldAutoFocusInput:t,children:e.jsx(d.EmbeddedSearch.Wrapper,{"data-composite":d.dataAttr(!!r||n?.open),children:e.jsxs(d.EmbeddedSearch.Root,{children:[e.jsx(u,{...s}),e.jsxs(d.EmbeddedSearch.Content,{children:[e.jsx(m,{...s}),e.jsx(S,{})]}),e.jsx(x,{})]})})})}function u(s){const{onToggleView:r,askAILabel:c,searchLabel:t}=s,{query:n}=d.useSearch();return e.jsxs(d.EmbeddedSearch.InputGroup,{children:[e.jsx(d.EmbeddedSearch.InputIcon,{}),e.jsx(d.EmbeddedSearch.Input,{}),e.jsx(d.EmbeddedSearch.Loading,{}),r&&e.jsx(a.WidgetToggle,{onToggleView:r,query:n,askAILabel:c,searchLabel:t,view:"search"}),e.jsx(d.Modal.Close,{})]})}function m(s){const{askAILabel:r,onToggleView:c,shouldShowAskAICard:t=!!c}=s,{query:n}=d.useSearch(),{handleToggle:i}=a.useToggleView({onToggleView:c,query:n});return t?e.jsxs(d.EmbeddedSearch.AskAITrigger,{onSelect:()=>i("chat",!0),children:[e.jsx(d.EmbeddedSearch.AskAITriggerIcon,{}),e.jsxs(d.EmbeddedSearch.AskAITriggerLabel,{children:[r||"Ask AI",n&&` "${n}"`]}),e.jsx(d.EmbeddedSearch.AskAITriggerIndicator,{})]}):null}function S(){return e.jsxs(d.EmbeddedSearch.Results,{children:[e.jsx(d.EmbeddedSearch.ResultsLoading,{}),e.jsx(d.EmbeddedSearch.ResultsTabList,{children:s=>s.map(r=>e.jsx(d.EmbeddedSearch.ResultsTab,{tab:r},r))}),e.jsx(d.EmbeddedSearch.ResultsEmpty,{}),e.jsxs(d.EmbeddedSearch.ResultsScrollArea,{children:[e.jsx(d.EmbeddedSearch.ResultsScrollAreaViewport,{children:e.jsx(b,{})}),e.jsx(d.EmbeddedSearch.ResultsScrollAreaScrollbar,{children:e.jsx(d.EmbeddedSearch.ResultsScrollAreaThumb,{})}),e.jsx(d.EmbeddedSearch.ResultsScrollAreaCorner,{})]})]})}function b(){return e.jsx(d.EmbeddedSearch.ResultsList,{children:s=>s.map(r=>e.jsxs(d.EmbeddedSearch.ResultsItem,{item:r,children:[e.jsx(d.EmbeddedSearch.ResultsItemBreadcrumbs,{children:c=>c.map(t=>e.jsxs(o.Fragment,{children:[t,e.jsx(d.EmbeddedSearch.ResultsItemBreadcrumbIcon,{})]},t))}),e.jsx(d.EmbeddedSearch.ResultsItemIcon,{}),e.jsx(d.EmbeddedSearch.ResultsItemTitle,{}),e.jsx(d.EmbeddedSearch.ResultsItemTag,{}),e.jsx(d.EmbeddedSearch.ResultsItemDescription,{children:c=>c.map((t,n)=>e.jsx(d.EmbeddedSearch.ResultsItemDescriptionPart,{part:t},`part-${n}`))}),e.jsx(d.EmbeddedSearch.ResultsItemIndicator,{})]},r.id))})}function x(){return e.jsx(d.EmbeddedSearch.Footer,{children:e.jsxs(d.EmbeddedSearch.TaglineContainer,{children:[e.jsx(d.EmbeddedSearch.TaglineText,{}),e.jsx(d.EmbeddedSearch.TaglineLogo,{}),e.jsx(d.EmbeddedSearch.TaglineBrandName,{})]})})}exports.InkeepEmbeddedSearch=h;exports.InkeepEmbeddedSearchImpl=l;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { WidgetView, InkeepConfig } from '@inkeep/cxkit-types';
|
|
2
|
+
import { EmbeddedSearchProviderProps } from '@inkeep/cxkit-styled';
|
|
3
|
+
type SearchConfig = Pick<InkeepConfig, 'baseSettings' | 'searchSettings'>;
|
|
4
|
+
type InkeepEmbeddedSearchImplProps = EmbeddedSearchProviderProps & WidgetView & {
|
|
5
|
+
/**
|
|
6
|
+
* Whether to show the Ask AI card.
|
|
7
|
+
* @default false
|
|
8
|
+
*/
|
|
9
|
+
shouldShowAskAICard?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export type InkeepEmbeddedSearchProps = InkeepEmbeddedSearchImplProps & Partial<SearchConfig>;
|
|
12
|
+
export declare function InkeepEmbeddedSearch(props: InkeepEmbeddedSearchProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function InkeepEmbeddedSearchImpl(props: InkeepEmbeddedSearchImplProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { WidgetView, InkeepConfig } from '@inkeep/cxkit-types';
|
|
2
|
+
import { EmbeddedSearchProviderProps } from '@inkeep/cxkit-styled';
|
|
3
|
+
type SearchConfig = Pick<InkeepConfig, 'baseSettings' | 'searchSettings'>;
|
|
4
|
+
type InkeepEmbeddedSearchImplProps = EmbeddedSearchProviderProps & WidgetView & {
|
|
5
|
+
/**
|
|
6
|
+
* Whether to show the Ask AI card.
|
|
7
|
+
* @default false
|
|
8
|
+
*/
|
|
9
|
+
shouldShowAskAICard?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export type InkeepEmbeddedSearchProps = InkeepEmbeddedSearchImplProps & Partial<SearchConfig>;
|
|
12
|
+
export declare function InkeepEmbeddedSearch(props: InkeepEmbeddedSearchProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function InkeepEmbeddedSearchImpl(props: InkeepEmbeddedSearchImplProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
3
|
+
import { Shadow as a, RootProvider as d, WebWidgetInteractionType as g, useModal as h, EmbeddedSearch as r, dataAttr as I, useSearch as c, Modal as m } from "@inkeep/cxkit-styled";
|
|
4
|
+
import { Fragment as p } from "react";
|
|
5
|
+
import { WidgetToggle as R, useToggleView as A } from "./widget-toggle.js";
|
|
6
|
+
function V(n) {
|
|
7
|
+
const { baseSettings: t, searchSettings: s } = n;
|
|
8
|
+
return /* @__PURE__ */ e(a, { children: /* @__PURE__ */ e(
|
|
9
|
+
d,
|
|
10
|
+
{
|
|
11
|
+
config: {
|
|
12
|
+
baseSettings: t,
|
|
13
|
+
searchSettings: s
|
|
14
|
+
},
|
|
15
|
+
interactionType: g.EmbeddedSearch,
|
|
16
|
+
children: /* @__PURE__ */ e(T, { ...n })
|
|
17
|
+
}
|
|
18
|
+
) });
|
|
19
|
+
}
|
|
20
|
+
function T(n) {
|
|
21
|
+
const { onToggleView: t, isHidden: s, shouldAutoFocusInput: l = !t } = n, i = h();
|
|
22
|
+
return /* @__PURE__ */ e(r.Provider, { isHidden: s, shouldAutoFocusInput: l, children: /* @__PURE__ */ e(r.Wrapper, { "data-composite": I(!!t || i?.open), children: /* @__PURE__ */ o(r.Root, { children: [
|
|
23
|
+
/* @__PURE__ */ e(S, { ...n }),
|
|
24
|
+
/* @__PURE__ */ o(r.Content, { children: [
|
|
25
|
+
/* @__PURE__ */ e(b, { ...n }),
|
|
26
|
+
/* @__PURE__ */ e(f, {})
|
|
27
|
+
] }),
|
|
28
|
+
/* @__PURE__ */ e(L, {})
|
|
29
|
+
] }) }) });
|
|
30
|
+
}
|
|
31
|
+
function S(n) {
|
|
32
|
+
const { onToggleView: t, askAILabel: s, searchLabel: l } = n, { query: i } = c();
|
|
33
|
+
return /* @__PURE__ */ o(r.InputGroup, { children: [
|
|
34
|
+
/* @__PURE__ */ e(r.InputIcon, {}),
|
|
35
|
+
/* @__PURE__ */ e(r.Input, {}),
|
|
36
|
+
/* @__PURE__ */ e(r.Loading, {}),
|
|
37
|
+
t && /* @__PURE__ */ e(
|
|
38
|
+
R,
|
|
39
|
+
{
|
|
40
|
+
onToggleView: t,
|
|
41
|
+
query: i,
|
|
42
|
+
askAILabel: s,
|
|
43
|
+
searchLabel: l,
|
|
44
|
+
view: "search"
|
|
45
|
+
}
|
|
46
|
+
),
|
|
47
|
+
/* @__PURE__ */ e(m.Close, {})
|
|
48
|
+
] });
|
|
49
|
+
}
|
|
50
|
+
function b(n) {
|
|
51
|
+
const { askAILabel: t, onToggleView: s, shouldShowAskAICard: l = !!s } = n, { query: i } = c(), { handleToggle: u } = A({
|
|
52
|
+
onToggleView: s,
|
|
53
|
+
query: i
|
|
54
|
+
});
|
|
55
|
+
return l ? /* @__PURE__ */ o(r.AskAITrigger, { onSelect: () => u("chat", !0), children: [
|
|
56
|
+
/* @__PURE__ */ e(r.AskAITriggerIcon, {}),
|
|
57
|
+
/* @__PURE__ */ o(r.AskAITriggerLabel, { children: [
|
|
58
|
+
t || "Ask AI",
|
|
59
|
+
i && ` "${i}"`
|
|
60
|
+
] }),
|
|
61
|
+
/* @__PURE__ */ e(r.AskAITriggerIndicator, {})
|
|
62
|
+
] }) : null;
|
|
63
|
+
}
|
|
64
|
+
function f() {
|
|
65
|
+
return /* @__PURE__ */ o(r.Results, { children: [
|
|
66
|
+
/* @__PURE__ */ e(r.ResultsLoading, {}),
|
|
67
|
+
/* @__PURE__ */ e(r.ResultsTabList, { children: (n) => n.map((t) => /* @__PURE__ */ e(r.ResultsTab, { tab: t }, t)) }),
|
|
68
|
+
/* @__PURE__ */ e(r.ResultsEmpty, {}),
|
|
69
|
+
/* @__PURE__ */ o(r.ResultsScrollArea, { children: [
|
|
70
|
+
/* @__PURE__ */ e(r.ResultsScrollAreaViewport, { children: /* @__PURE__ */ e(k, {}) }),
|
|
71
|
+
/* @__PURE__ */ e(r.ResultsScrollAreaScrollbar, { children: /* @__PURE__ */ e(r.ResultsScrollAreaThumb, {}) }),
|
|
72
|
+
/* @__PURE__ */ e(r.ResultsScrollAreaCorner, {})
|
|
73
|
+
] })
|
|
74
|
+
] });
|
|
75
|
+
}
|
|
76
|
+
function k() {
|
|
77
|
+
return /* @__PURE__ */ e(r.ResultsList, { children: (n) => n.map((t) => /* @__PURE__ */ o(r.ResultsItem, { item: t, children: [
|
|
78
|
+
/* @__PURE__ */ e(r.ResultsItemBreadcrumbs, { children: (s) => s.map((l) => /* @__PURE__ */ o(p, { children: [
|
|
79
|
+
l,
|
|
80
|
+
/* @__PURE__ */ e(r.ResultsItemBreadcrumbIcon, {})
|
|
81
|
+
] }, l)) }),
|
|
82
|
+
/* @__PURE__ */ e(r.ResultsItemIcon, {}),
|
|
83
|
+
/* @__PURE__ */ e(r.ResultsItemTitle, {}),
|
|
84
|
+
/* @__PURE__ */ e(r.ResultsItemTag, {}),
|
|
85
|
+
/* @__PURE__ */ e(r.ResultsItemDescription, { children: (s) => s.map((l, i) => /* @__PURE__ */ e(r.ResultsItemDescriptionPart, { part: l }, `part-${i}`)) }),
|
|
86
|
+
/* @__PURE__ */ e(r.ResultsItemIndicator, {})
|
|
87
|
+
] }, t.id)) });
|
|
88
|
+
}
|
|
89
|
+
function L() {
|
|
90
|
+
return /* @__PURE__ */ e(r.Footer, { children: /* @__PURE__ */ o(r.TaglineContainer, { children: [
|
|
91
|
+
/* @__PURE__ */ e(r.TaglineText, {}),
|
|
92
|
+
/* @__PURE__ */ e(r.TaglineLogo, {}),
|
|
93
|
+
/* @__PURE__ */ e(r.TaglineBrandName, {})
|
|
94
|
+
] }) });
|
|
95
|
+
}
|
|
96
|
+
export {
|
|
97
|
+
V as InkeepEmbeddedSearch,
|
|
98
|
+
T as InkeepEmbeddedSearchImpl
|
|
99
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./embedded-chat.cjs"),d=require("./embedded-search-and-chat.cjs"),n=require("./embedded-search.cjs"),I=require("./modal.chat.cjs"),h=require("./modal.search-and-chat.cjs"),p=require("./modal.search.cjs"),l=require("./modal.cjs"),a=require("./chat-button.cjs"),t=require("./searchbar.cjs"),r=require("./intelligent-form.cjs");exports.InkeepEmbeddedChat=e.InkeepEmbeddedChat;exports.InkeepEmbeddedChatImpl=e.InkeepEmbeddedChatImpl;exports.InkeepEmbeddedSearchAndChat=d.InkeepEmbeddedSearchAndChat;exports.InkeepEmbeddedSearchAndChatImpl=d.InkeepEmbeddedSearchAndChatImpl;exports.InkeepEmbeddedSearch=n.InkeepEmbeddedSearch;exports.InkeepEmbeddedSearchImpl=n.InkeepEmbeddedSearchImpl;exports.InkeepModalChat=I.InkeepModalChat;exports.InkeepModalSearchAndChat=h.InkeepModalSearchAndChat;exports.InkeepModalSearch=p.InkeepModalSearch;exports.InkeepModal=l.InkeepModal;exports.ChatButtonImpl=a.ChatButtonImpl;exports.InkeepChatButton=a.InkeepChatButton;exports.InkeepSearchBar=t.InkeepSearchBar;exports.SearchBarImpl=t.SearchBarImpl;exports.InkeepIntelligentForm=r.InkeepIntelligentForm;exports.InkeepIntelligentFormImpl=r.InkeepIntelligentFormImpl;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './embedded-chat';
|
|
2
|
+
export * from './embedded-search-and-chat';
|
|
3
|
+
export * from './embedded-search';
|
|
4
|
+
export * from './modal.chat';
|
|
5
|
+
export * from './modal.search-and-chat';
|
|
6
|
+
export * from './modal.search';
|
|
7
|
+
export * from './modal';
|
|
8
|
+
export * from './chat-button';
|
|
9
|
+
export * from './searchbar';
|
|
10
|
+
export * from './intelligent-form';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './embedded-chat';
|
|
2
|
+
export * from './embedded-search-and-chat';
|
|
3
|
+
export * from './embedded-search';
|
|
4
|
+
export * from './modal.chat';
|
|
5
|
+
export * from './modal.search-and-chat';
|
|
6
|
+
export * from './modal.search';
|
|
7
|
+
export * from './modal';
|
|
8
|
+
export * from './chat-button';
|
|
9
|
+
export * from './searchbar';
|
|
10
|
+
export * from './intelligent-form';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { InkeepEmbeddedChat as p, InkeepEmbeddedChatImpl as o } from "./embedded-chat.js";
|
|
2
|
+
import { InkeepEmbeddedSearchAndChat as d, InkeepEmbeddedSearchAndChatImpl as m } from "./embedded-search-and-chat.js";
|
|
3
|
+
import { InkeepEmbeddedSearch as a, InkeepEmbeddedSearchImpl as I } from "./embedded-search.js";
|
|
4
|
+
import { InkeepModalChat as k } from "./modal.chat.js";
|
|
5
|
+
import { InkeepModalSearchAndChat as f } from "./modal.search-and-chat.js";
|
|
6
|
+
import { InkeepModalSearch as c } from "./modal.search.js";
|
|
7
|
+
import { InkeepModal as S } from "./modal.js";
|
|
8
|
+
import { ChatButtonImpl as E, InkeepChatButton as B } from "./chat-button.js";
|
|
9
|
+
import { InkeepSearchBar as A, SearchBarImpl as g } from "./searchbar.js";
|
|
10
|
+
import { InkeepIntelligentForm as u, InkeepIntelligentFormImpl as F } from "./intelligent-form.js";
|
|
11
|
+
export {
|
|
12
|
+
E as ChatButtonImpl,
|
|
13
|
+
B as InkeepChatButton,
|
|
14
|
+
p as InkeepEmbeddedChat,
|
|
15
|
+
o as InkeepEmbeddedChatImpl,
|
|
16
|
+
a as InkeepEmbeddedSearch,
|
|
17
|
+
d as InkeepEmbeddedSearchAndChat,
|
|
18
|
+
m as InkeepEmbeddedSearchAndChatImpl,
|
|
19
|
+
I as InkeepEmbeddedSearchImpl,
|
|
20
|
+
u as InkeepIntelligentForm,
|
|
21
|
+
F as InkeepIntelligentFormImpl,
|
|
22
|
+
S as InkeepModal,
|
|
23
|
+
k as InkeepModalChat,
|
|
24
|
+
c as InkeepModalSearch,
|
|
25
|
+
f as InkeepModalSearchAndChat,
|
|
26
|
+
A as InkeepSearchBar,
|
|
27
|
+
g as SearchBarImpl
|
|
28
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("@inkeep/cxkit-styled");function m(r){const{baseSettings:t}=r;return e.jsx(n.Shadow,{wrapperStyles:{height:"inherit",width:"inherit"},children:e.jsx(n.RootProvider,{config:{baseSettings:t},interactionType:n.WebWidgetInteractionType.IntelligentForm,children:e.jsx(s,{...r})})})}function s(r){const{formConfig:t}=r;return e.jsx(n.IntelligentForm.Provider,{formConfig:t,children:e.jsxs(n.IntelligentForm.Root,{children:[e.jsx(n.IntelligentForm.Heading,{}),e.jsx(n.IntelligentForm.Content,{children:e.jsxs(n.IntelligentForm.ContentScrollArea,{children:[e.jsxs(n.IntelligentForm.ContentScrollAreaViewport,{children:[e.jsx(I,{}),e.jsx(g,{}),e.jsx(F,{}),e.jsx(u,{}),e.jsx(x,{})]}),e.jsx(n.IntelligentForm.ContentScrollAreaScrollbar,{children:e.jsx(n.IntelligentForm.ContentScrollAreaThumb,{})}),e.jsx(n.IntelligentForm.ContentScrollAreaCorner,{})]})})]})})}function I(){return e.jsxs(n.IntelligentForm.Success,{children:[e.jsx(n.IntelligentForm.SuccessIcon,{}),e.jsx(n.IntelligentForm.SuccessHeading,{}),e.jsx(n.IntelligentForm.SuccessMessage,{})]})}function g(){const{isSubmitSuccessful:r}=n.useIntelligentForm();return r?null:e.jsxs(n.IntelligentForm.PrimaryForm,{children:[e.jsx(n.IntelligentForm.PrimaryFormDescription,{}),e.jsx(n.IntelligentForm.PrimaryFormFields,{children:t=>t.map(l=>e.jsx(c,{field:l},l.name))}),e.jsx(n.IntelligentForm.PrimaryFormSubmit,{})]})}function o(){return e.jsxs(n.IntelligentForm.BotHeading,{children:[e.jsx(n.IntelligentForm.BotHeadingIcon,{}),e.jsx(n.IntelligentForm.BotHeadingName,{})]})}function F(){return e.jsxs(n.IntelligentForm.Loading,{children:[e.jsx(o,{}),e.jsx(n.LoadingIndicator,{})]})}function u(){const{isSubmitSuccessful:r}=n.useIntelligentForm();return r?null:e.jsxs(n.IntelligentForm.ConfidentResponse,{children:[e.jsx(o,{}),e.jsxs(n.IntelligentForm.Sources,{children:[e.jsx(n.IntelligentForm.SourcesCaption,{}),e.jsx(n.IntelligentForm.SourcesList,{children:t=>t.map(l=>e.jsxs(n.IntelligentForm.Source,{source:l,children:[e.jsx(n.IntelligentForm.SourceIcon,{}),e.jsx(n.IntelligentForm.SourceTitle,{})]},l.url))})]}),e.jsx(n.IntelligentForm.ConfidentAnswer,{}),e.jsxs(n.IntelligentForm.ConfidentResponseButton,{children:[e.jsx(n.IntelligentForm.ConfidentResponseButtonIcon,{}),e.jsx(n.IntelligentForm.ConfidentResponseButtonLabel,{})]})]})}function x(){const{aiResponse:r}=n.useIntelligentForm(),{isSubmitSuccessful:t}=n.useIntelligentForm();return t?null:e.jsxs(n.IntelligentForm.SecondaryForm,{children:[e.jsx(o,{}),!r.answerConfidence&&e.jsxs(n.IntelligentForm.Sources,{children:[e.jsx(n.IntelligentForm.SourcesCaption,{children:"I wasn't able to find a direct answer to your question, but here's some helpful sources:"}),e.jsx(n.IntelligentForm.SourcesList,{children:l=>l.map(i=>e.jsxs(n.IntelligentForm.Source,{source:i,children:[e.jsx(n.IntelligentForm.SourceIcon,{}),e.jsx(n.IntelligentForm.SourceTitle,{})]},i.url))})]}),e.jsx(n.IntelligentForm.SecondaryFormDescription,{}),e.jsx(n.IntelligentForm.SecondaryFormFields,{children:l=>l.map(i=>e.jsx(c,{field:i},i.name))}),e.jsx(n.IntelligentForm.Error,{}),e.jsx(n.IntelligentForm.SecondaryFormSubmit,{})]})}function c(r){const{field:t}=r;return e.jsxs(n.IntelligentForm.Field,{field:t,children:[e.jsx(n.IntelligentForm.FieldLabel,{}),t.inputType==="TEXT"&&e.jsx(n.IntelligentForm.Text,{}),t.inputType==="EMAIL"&&e.jsx(n.IntelligentForm.Email,{}),t.inputType==="FILE"&&e.jsx(n.IntelligentForm.File,{}),t.inputType==="TEXTAREA"&&e.jsx(n.IntelligentForm.TextArea,{}),t.inputType==="CHECKBOX"&&e.jsx(n.IntelligentForm.Checkbox,{children:e.jsx(n.IntelligentForm.CheckboxIndicator,{})}),t.inputType==="SELECT"&&e.jsxs(n.IntelligentForm.Select,{children:[e.jsxs(n.IntelligentForm.SelectTrigger,{children:[e.jsx(n.IntelligentForm.SelectValue,{}),e.jsx(n.IntelligentForm.SelectIcon,{})]}),e.jsx(n.IntelligentForm.SelectContent,{children:e.jsx(n.IntelligentForm.SelectViewport,{children:t.items.map(l=>e.jsxs(n.IntelligentForm.SelectItem,{value:l.value,children:[e.jsx(n.IntelligentForm.SelectItemText,{children:l.label}),e.jsx(n.IntelligentForm.SelectItemIndicator,{})]},l.value))})})]}),e.jsx(n.IntelligentForm.FieldError,{})]},t.name)}exports.InkeepIntelligentForm=m;exports.InkeepIntelligentFormImpl=s;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { InkeepConfig, IntelligentFormConfig } from '@inkeep/cxkit-types';
|
|
2
|
+
interface InkeepIntelligentFormImplProps {
|
|
3
|
+
formConfig: IntelligentFormConfig;
|
|
4
|
+
}
|
|
5
|
+
export type InkeepIntelligentFormProps = InkeepIntelligentFormImplProps & Partial<Pick<InkeepConfig, 'baseSettings'>>;
|
|
6
|
+
export declare function InkeepIntelligentForm(props: InkeepIntelligentFormProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function InkeepIntelligentFormImpl(props: InkeepIntelligentFormImplProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { InkeepConfig, IntelligentFormConfig } from '@inkeep/cxkit-types';
|
|
2
|
+
interface InkeepIntelligentFormImplProps {
|
|
3
|
+
formConfig: IntelligentFormConfig;
|
|
4
|
+
}
|
|
5
|
+
export type InkeepIntelligentFormProps = InkeepIntelligentFormImplProps & Partial<Pick<InkeepConfig, 'baseSettings'>>;
|
|
6
|
+
export declare function InkeepIntelligentForm(props: InkeepIntelligentFormProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function InkeepIntelligentFormImpl(props: InkeepIntelligentFormImplProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as n, jsxs as t } from "react/jsx-runtime";
|
|
3
|
+
import { Shadow as s, RootProvider as a, WebWidgetInteractionType as S, IntelligentForm as e, useIntelligentForm as l, LoadingIndicator as m } from "@inkeep/cxkit-styled";
|
|
4
|
+
function T(o) {
|
|
5
|
+
const { baseSettings: r } = o;
|
|
6
|
+
return /* @__PURE__ */ n(
|
|
7
|
+
s,
|
|
8
|
+
{
|
|
9
|
+
wrapperStyles: {
|
|
10
|
+
height: "inherit",
|
|
11
|
+
width: "inherit"
|
|
12
|
+
},
|
|
13
|
+
children: /* @__PURE__ */ n(
|
|
14
|
+
a,
|
|
15
|
+
{
|
|
16
|
+
config: {
|
|
17
|
+
baseSettings: r
|
|
18
|
+
},
|
|
19
|
+
interactionType: S.IntelligentForm,
|
|
20
|
+
children: /* @__PURE__ */ n(h, { ...o })
|
|
21
|
+
}
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
function h(o) {
|
|
27
|
+
const { formConfig: r } = o;
|
|
28
|
+
return /* @__PURE__ */ n(e.Provider, { formConfig: r, children: /* @__PURE__ */ t(e.Root, { children: [
|
|
29
|
+
/* @__PURE__ */ n(e.Heading, {}),
|
|
30
|
+
/* @__PURE__ */ n(e.Content, { children: /* @__PURE__ */ t(e.ContentScrollArea, { children: [
|
|
31
|
+
/* @__PURE__ */ t(e.ContentScrollAreaViewport, { children: [
|
|
32
|
+
/* @__PURE__ */ n(p, {}),
|
|
33
|
+
/* @__PURE__ */ n(f, {}),
|
|
34
|
+
/* @__PURE__ */ n(I, {}),
|
|
35
|
+
/* @__PURE__ */ n(C, {}),
|
|
36
|
+
/* @__PURE__ */ n(F, {})
|
|
37
|
+
] }),
|
|
38
|
+
/* @__PURE__ */ n(e.ContentScrollAreaScrollbar, { children: /* @__PURE__ */ n(e.ContentScrollAreaThumb, {}) }),
|
|
39
|
+
/* @__PURE__ */ n(e.ContentScrollAreaCorner, {})
|
|
40
|
+
] }) })
|
|
41
|
+
] }) });
|
|
42
|
+
}
|
|
43
|
+
function p() {
|
|
44
|
+
return /* @__PURE__ */ t(e.Success, { children: [
|
|
45
|
+
/* @__PURE__ */ n(e.SuccessIcon, {}),
|
|
46
|
+
/* @__PURE__ */ n(e.SuccessHeading, {}),
|
|
47
|
+
/* @__PURE__ */ n(e.SuccessMessage, {})
|
|
48
|
+
] });
|
|
49
|
+
}
|
|
50
|
+
function f() {
|
|
51
|
+
const { isSubmitSuccessful: o } = l();
|
|
52
|
+
return o ? null : /* @__PURE__ */ t(e.PrimaryForm, { children: [
|
|
53
|
+
/* @__PURE__ */ n(e.PrimaryFormDescription, {}),
|
|
54
|
+
/* @__PURE__ */ n(e.PrimaryFormFields, { children: (r) => r.map((i) => /* @__PURE__ */ n(d, { field: i }, i.name)) }),
|
|
55
|
+
/* @__PURE__ */ n(e.PrimaryFormSubmit, {})
|
|
56
|
+
] });
|
|
57
|
+
}
|
|
58
|
+
function u() {
|
|
59
|
+
return /* @__PURE__ */ t(e.BotHeading, { children: [
|
|
60
|
+
/* @__PURE__ */ n(e.BotHeadingIcon, {}),
|
|
61
|
+
/* @__PURE__ */ n(e.BotHeadingName, {})
|
|
62
|
+
] });
|
|
63
|
+
}
|
|
64
|
+
function I() {
|
|
65
|
+
return /* @__PURE__ */ t(e.Loading, { children: [
|
|
66
|
+
/* @__PURE__ */ n(u, {}),
|
|
67
|
+
/* @__PURE__ */ n(m, {})
|
|
68
|
+
] });
|
|
69
|
+
}
|
|
70
|
+
function C() {
|
|
71
|
+
const { isSubmitSuccessful: o } = l();
|
|
72
|
+
return o ? null : /* @__PURE__ */ t(e.ConfidentResponse, { children: [
|
|
73
|
+
/* @__PURE__ */ n(u, {}),
|
|
74
|
+
/* @__PURE__ */ t(e.Sources, { children: [
|
|
75
|
+
/* @__PURE__ */ n(e.SourcesCaption, {}),
|
|
76
|
+
/* @__PURE__ */ n(e.SourcesList, { children: (r) => r.map((i) => /* @__PURE__ */ t(e.Source, { source: i, children: [
|
|
77
|
+
/* @__PURE__ */ n(e.SourceIcon, {}),
|
|
78
|
+
/* @__PURE__ */ n(e.SourceTitle, {})
|
|
79
|
+
] }, i.url)) })
|
|
80
|
+
] }),
|
|
81
|
+
/* @__PURE__ */ n(e.ConfidentAnswer, {}),
|
|
82
|
+
/* @__PURE__ */ t(e.ConfidentResponseButton, { children: [
|
|
83
|
+
/* @__PURE__ */ n(e.ConfidentResponseButtonIcon, {}),
|
|
84
|
+
/* @__PURE__ */ n(e.ConfidentResponseButtonLabel, {})
|
|
85
|
+
] })
|
|
86
|
+
] });
|
|
87
|
+
}
|
|
88
|
+
function F() {
|
|
89
|
+
const { aiResponse: o } = l(), { isSubmitSuccessful: r } = l();
|
|
90
|
+
return r ? null : /* @__PURE__ */ t(e.SecondaryForm, { children: [
|
|
91
|
+
/* @__PURE__ */ n(u, {}),
|
|
92
|
+
!o.answerConfidence && /* @__PURE__ */ t(e.Sources, { children: [
|
|
93
|
+
/* @__PURE__ */ n(e.SourcesCaption, { children: "I wasn't able to find a direct answer to your question, but here's some helpful sources:" }),
|
|
94
|
+
/* @__PURE__ */ n(e.SourcesList, { children: (i) => i.map((c) => /* @__PURE__ */ t(e.Source, { source: c, children: [
|
|
95
|
+
/* @__PURE__ */ n(e.SourceIcon, {}),
|
|
96
|
+
/* @__PURE__ */ n(e.SourceTitle, {})
|
|
97
|
+
] }, c.url)) })
|
|
98
|
+
] }),
|
|
99
|
+
/* @__PURE__ */ n(e.SecondaryFormDescription, {}),
|
|
100
|
+
/* @__PURE__ */ n(e.SecondaryFormFields, { children: (i) => i.map((c) => /* @__PURE__ */ n(d, { field: c }, c.name)) }),
|
|
101
|
+
/* @__PURE__ */ n(e.Error, {}),
|
|
102
|
+
/* @__PURE__ */ n(e.SecondaryFormSubmit, {})
|
|
103
|
+
] });
|
|
104
|
+
}
|
|
105
|
+
function d(o) {
|
|
106
|
+
const { field: r } = o;
|
|
107
|
+
return /* @__PURE__ */ t(e.Field, { field: r, children: [
|
|
108
|
+
/* @__PURE__ */ n(e.FieldLabel, {}),
|
|
109
|
+
r.inputType === "TEXT" && /* @__PURE__ */ n(e.Text, {}),
|
|
110
|
+
r.inputType === "EMAIL" && /* @__PURE__ */ n(e.Email, {}),
|
|
111
|
+
r.inputType === "FILE" && /* @__PURE__ */ n(e.File, {}),
|
|
112
|
+
r.inputType === "TEXTAREA" && /* @__PURE__ */ n(e.TextArea, {}),
|
|
113
|
+
r.inputType === "CHECKBOX" && /* @__PURE__ */ n(e.Checkbox, { children: /* @__PURE__ */ n(e.CheckboxIndicator, {}) }),
|
|
114
|
+
r.inputType === "SELECT" && /* @__PURE__ */ t(e.Select, { children: [
|
|
115
|
+
/* @__PURE__ */ t(e.SelectTrigger, { children: [
|
|
116
|
+
/* @__PURE__ */ n(e.SelectValue, {}),
|
|
117
|
+
/* @__PURE__ */ n(e.SelectIcon, {})
|
|
118
|
+
] }),
|
|
119
|
+
/* @__PURE__ */ n(e.SelectContent, { children: /* @__PURE__ */ n(e.SelectViewport, { children: r.items.map((i) => /* @__PURE__ */ t(e.SelectItem, { value: i.value, children: [
|
|
120
|
+
/* @__PURE__ */ n(e.SelectItemText, { children: i.label }),
|
|
121
|
+
/* @__PURE__ */ n(e.SelectItemIndicator, {})
|
|
122
|
+
] }, i.value)) }) })
|
|
123
|
+
] }),
|
|
124
|
+
/* @__PURE__ */ n(e.FieldError, {})
|
|
125
|
+
] }, r.name);
|
|
126
|
+
}
|
|
127
|
+
export {
|
|
128
|
+
T as InkeepIntelligentForm,
|
|
129
|
+
h as InkeepIntelligentFormImpl
|
|
130
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("./embedded-chat.cjs"),a=require("./modal.cjs"),d=require("@inkeep/cxkit-styled");function c(t){const{modalSettings:n,baseSettings:i,aiChatSettings:r,...o}=t;return e.jsx(a.InkeepModal,{interactionType:d.WebWidgetInteractionType.CustomTrigger,modalSettings:n,baseSettings:i,aiChatSettings:r,children:e.jsx(s.InkeepEmbeddedChatImpl,{...o})})}exports.InkeepModalChat=c;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { InkeepModalSettings } from '@inkeep/cxkit-types';
|
|
2
|
+
import { InkeepEmbeddedChatProps } from './embedded-chat';
|
|
3
|
+
export interface InkeepModalChatProps extends Omit<InkeepEmbeddedChatProps, 'onToggleView'> {
|
|
4
|
+
modalSettings?: InkeepModalSettings;
|
|
5
|
+
}
|
|
6
|
+
export declare function InkeepModalChat(props: InkeepModalChatProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { InkeepModalSettings } from '@inkeep/cxkit-types';
|
|
2
|
+
import { InkeepEmbeddedChatProps } from './embedded-chat';
|
|
3
|
+
export interface InkeepModalChatProps extends Omit<InkeepEmbeddedChatProps, 'onToggleView'> {
|
|
4
|
+
modalSettings?: InkeepModalSettings;
|
|
5
|
+
}
|
|
6
|
+
export declare function InkeepModalChat(props: InkeepModalChatProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { InkeepEmbeddedChatImpl as m } from "./embedded-chat.js";
|
|
4
|
+
import { InkeepModal as p } from "./modal.js";
|
|
5
|
+
import { WebWidgetInteractionType as a } from "@inkeep/cxkit-styled";
|
|
6
|
+
function l(t) {
|
|
7
|
+
const { modalSettings: o, baseSettings: r, aiChatSettings: i, ...n } = t;
|
|
8
|
+
return /* @__PURE__ */ e(
|
|
9
|
+
p,
|
|
10
|
+
{
|
|
11
|
+
interactionType: a.CustomTrigger,
|
|
12
|
+
modalSettings: o,
|
|
13
|
+
baseSettings: r,
|
|
14
|
+
aiChatSettings: i,
|
|
15
|
+
children: /* @__PURE__ */ e(m, { ...n })
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
l as InkeepModalChat
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("@inkeep/cxkit-styled");function c(o){const{interactionType:t,children:r,modalSettings:i,...l}=o;return e.jsx(n.Portal,{children:e.jsx(n.Shadow,{children:e.jsx(n.RootProvider,{config:{...l},interactionType:t,children:e.jsx(n.Modal.Root,{config:i,children:e.jsx(n.Modal.Overlay,{children:e.jsx(n.Modal.Content,{children:r})})})})})})}exports.InkeepModal=c;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { InkeepModalSettings } from '@inkeep/cxkit-types';
|
|
2
|
+
import { WebWidgetInteractionType, RootProviderProps } from '@inkeep/cxkit-styled';
|
|
3
|
+
type RootConfig = RootProviderProps['config'];
|
|
4
|
+
interface ModalConfig extends RootConfig {
|
|
5
|
+
/**
|
|
6
|
+
* The configuration for the modal.
|
|
7
|
+
*/
|
|
8
|
+
modalSettings?: InkeepModalSettings;
|
|
9
|
+
}
|
|
10
|
+
export interface InkeepModalProps extends ModalConfig {
|
|
11
|
+
/**
|
|
12
|
+
* The content of the modal.
|
|
13
|
+
*/
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* The interaction type for the modal widget.
|
|
17
|
+
*/
|
|
18
|
+
interactionType: (typeof WebWidgetInteractionType)[keyof typeof WebWidgetInteractionType];
|
|
19
|
+
}
|
|
20
|
+
export declare function InkeepModal(props: InkeepModalProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { InkeepModalSettings } from '@inkeep/cxkit-types';
|
|
2
|
+
import { WebWidgetInteractionType, RootProviderProps } from '@inkeep/cxkit-styled';
|
|
3
|
+
type RootConfig = RootProviderProps['config'];
|
|
4
|
+
interface ModalConfig extends RootConfig {
|
|
5
|
+
/**
|
|
6
|
+
* The configuration for the modal.
|
|
7
|
+
*/
|
|
8
|
+
modalSettings?: InkeepModalSettings;
|
|
9
|
+
}
|
|
10
|
+
export interface InkeepModalProps extends ModalConfig {
|
|
11
|
+
/**
|
|
12
|
+
* The content of the modal.
|
|
13
|
+
*/
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* The interaction type for the modal widget.
|
|
17
|
+
*/
|
|
18
|
+
interactionType: (typeof WebWidgetInteractionType)[keyof typeof WebWidgetInteractionType];
|
|
19
|
+
}
|
|
20
|
+
export declare function InkeepModal(props: InkeepModalProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
3
|
+
import { Portal as l, Shadow as d, RootProvider as a, Modal as e } from "@inkeep/cxkit-styled";
|
|
4
|
+
function m(n) {
|
|
5
|
+
const { interactionType: r, children: t, modalSettings: i, ...c } = n;
|
|
6
|
+
return /* @__PURE__ */ o(l, { children: /* @__PURE__ */ o(d, { children: /* @__PURE__ */ o(
|
|
7
|
+
a,
|
|
8
|
+
{
|
|
9
|
+
config: {
|
|
10
|
+
...c
|
|
11
|
+
},
|
|
12
|
+
interactionType: r,
|
|
13
|
+
children: /* @__PURE__ */ o(e.Root, { config: i, children: /* @__PURE__ */ o(e.Overlay, { children: /* @__PURE__ */ o(e.Content, { children: t }) }) })
|
|
14
|
+
}
|
|
15
|
+
) }) });
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
m as InkeepModal
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),s=require("./embedded-search-and-chat.cjs"),l=require("./modal.cjs"),u=require("./embedded-search-and-chat.impl.cjs"),m=require("@inkeep/cxkit-styled"),h=require("../utils.cjs");function g(e){const{modalSettings:t,...r}=e,{config:d,...n}=u.useWidgetImpl(r),o=h.composeEventHandlers(t?.onOpenChange,c=>{e.forceDefaultView&&!c&&n.setView(e.defaultView??"search")}),a={...t,onOpenChange:o};return i.jsx(l.InkeepModal,{...d,modalSettings:a,interactionType:m.WebWidgetInteractionType.CustomTrigger,children:i.jsx(s.InkeepEmbeddedSearchAndChatImpl,{...n})})}exports.InkeepModalSearchAndChat=g;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { InkeepModalSettings } from '@inkeep/cxkit-types';
|
|
2
|
+
import { InkeepEmbeddedSearchAndChatProps } from './embedded-search-and-chat';
|
|
3
|
+
export interface InkeepModalSearchAndChatProps extends InkeepEmbeddedSearchAndChatProps {
|
|
4
|
+
modalSettings?: InkeepModalSettings;
|
|
5
|
+
}
|
|
6
|
+
export declare function InkeepModalSearchAndChat(props: InkeepModalSearchAndChatProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { InkeepModalSettings } from '@inkeep/cxkit-types';
|
|
2
|
+
import { InkeepEmbeddedSearchAndChatProps } from './embedded-search-and-chat';
|
|
3
|
+
export interface InkeepModalSearchAndChatProps extends InkeepEmbeddedSearchAndChatProps {
|
|
4
|
+
modalSettings?: InkeepModalSettings;
|
|
5
|
+
}
|
|
6
|
+
export declare function InkeepModalSearchAndChat(props: InkeepModalSearchAndChatProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
3
|
+
import { InkeepEmbeddedSearchAndChatImpl as d } from "./embedded-search-and-chat.js";
|
|
4
|
+
import { InkeepModal as p } from "./modal.js";
|
|
5
|
+
import { useWidgetImpl as s } from "./embedded-search-and-chat.impl.js";
|
|
6
|
+
import { WebWidgetInteractionType as l } from "@inkeep/cxkit-styled";
|
|
7
|
+
import { composeEventHandlers as f } from "../utils.js";
|
|
8
|
+
function k(e) {
|
|
9
|
+
const { modalSettings: t, ...i } = e, { config: r, ...n } = s(i), m = f(t?.onOpenChange, (c) => {
|
|
10
|
+
e.forceDefaultView && !c && n.setView(e.defaultView ?? "search");
|
|
11
|
+
}), a = {
|
|
12
|
+
...t,
|
|
13
|
+
onOpenChange: m
|
|
14
|
+
};
|
|
15
|
+
return /* @__PURE__ */ o(
|
|
16
|
+
p,
|
|
17
|
+
{
|
|
18
|
+
...r,
|
|
19
|
+
modalSettings: a,
|
|
20
|
+
interactionType: l.CustomTrigger,
|
|
21
|
+
children: /* @__PURE__ */ o(d, { ...n })
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
k as InkeepModalSearchAndChat
|
|
27
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("./embedded-search.cjs"),c=require("./modal.cjs"),d=require("@inkeep/cxkit-styled");function u(t){const{modalSettings:r,baseSettings:n,searchSettings:o,...i}=t;return e.jsx(c.InkeepModal,{interactionType:d.WebWidgetInteractionType.CustomTrigger,modalSettings:r,baseSettings:n,searchSettings:o,children:e.jsx(s.InkeepEmbeddedSearchImpl,{shouldAutoFocusInput:!0,...i})})}exports.InkeepModalSearch=u;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { InkeepModalSettings } from '@inkeep/cxkit-types';
|
|
2
|
+
import { InkeepEmbeddedSearchProps } from './embedded-search';
|
|
3
|
+
export interface InkeepModalSearchProps extends Omit<InkeepEmbeddedSearchProps, 'onToggleView'> {
|
|
4
|
+
modalSettings?: InkeepModalSettings;
|
|
5
|
+
}
|
|
6
|
+
export declare function InkeepModalSearch(props: InkeepModalSearchProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { InkeepModalSettings } from '@inkeep/cxkit-types';
|
|
2
|
+
import { InkeepEmbeddedSearchProps } from './embedded-search';
|
|
3
|
+
export interface InkeepModalSearchProps extends Omit<InkeepEmbeddedSearchProps, 'onToggleView'> {
|
|
4
|
+
modalSettings?: InkeepModalSettings;
|
|
5
|
+
}
|
|
6
|
+
export declare function InkeepModalSearch(props: InkeepModalSearchProps): import("react/jsx-runtime").JSX.Element;
|