@inkeep/cxkit-react 0.5.93 → 0.5.94
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"),d=require("@inkeep/cxkit-styled"),i=require("react"),h=require("./widget-toggle.cjs"),b=require("./modal.cjs");function x(r){const{baseSettings:s,searchSettings:t}=r;return e.jsx(d.ErrorBoundary,{children:e.jsx(d.Shadow,{children:e.jsx(d.RootProvider,{config:{baseSettings:s,searchSettings:t},componentType:d.WebWidgetInteractionType.EmbeddedSearch,children:e.jsx(m,{...r})})})})}function o(r){const{children:s,onToggleView:t,isHidden:c,shouldAutoFocusInput:n=!t}=r;return e.jsx(d.EmbeddedSearch.Provider,{isHidden:c,shouldAutoFocusInput:n,children:s})}function m(r){return e.jsx(o,{...r,children:e.jsx(u,{...r})})}function u(r){const{searchSettings:{view:s}}=d.useInkeepConfig(),{onToggleView:t,shouldShowAskAICard:c=!!t&&s!=="dual-pane"}=r,n=d.useModal(),a=d.useWidget(),l=n&&!a?b.ModalContent:i.Fragment;return e.jsx(l,{children:e.jsx(d.EmbeddedSearch.Wrapper,{"data-show-ask-ai-card":d.dataAttr(c),"data-composite":d.dataAttr(!!t||n?.isOpen),children:e.jsxs(d.EmbeddedSearch.Root,{children:[e.jsx(j,{...r}),e.jsxs(d.EmbeddedSearch.Content,{children:[e.jsx(I,{askAICardLabel:r.askAICardLabel,askAILabel:r.askAILabel,onToggleView:r.onToggleView,shouldShowAskAICard:c}),e.jsx(E,{})]}),e.jsx(A,{})]})})})}function j(r){const{onToggleView:s,askAILabel:t,searchLabel:c}=r,n=d.useCommandState(
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("@inkeep/cxkit-styled"),i=require("react"),h=require("./widget-toggle.cjs"),b=require("./modal.cjs");function x(r){const{baseSettings:s,searchSettings:t}=r;return e.jsx(d.ErrorBoundary,{children:e.jsx(d.Shadow,{children:e.jsx(d.RootProvider,{config:{baseSettings:s,searchSettings:t},componentType:d.WebWidgetInteractionType.EmbeddedSearch,children:e.jsx(m,{...r})})})})}function o(r){const{children:s,onToggleView:t,isHidden:c,shouldAutoFocusInput:n=!t}=r;return e.jsx(d.EmbeddedSearch.Provider,{isHidden:c,shouldAutoFocusInput:n,children:s})}function m(r){return e.jsx(o,{...r,children:e.jsx(u,{...r})})}function u(r){const{searchSettings:{view:s}}=d.useInkeepConfig(),{onToggleView:t,shouldShowAskAICard:c=!!t&&s!=="dual-pane"}=r,n=d.useModal(),a=d.useWidget(),l=n&&!a?b.ModalContent:i.Fragment;return e.jsx(l,{children:e.jsx(d.EmbeddedSearch.Wrapper,{"data-show-ask-ai-card":d.dataAttr(c),"data-composite":d.dataAttr(!!t||n?.isOpen),children:e.jsxs(d.EmbeddedSearch.Root,{children:[e.jsx(j,{...r}),e.jsxs(d.EmbeddedSearch.Content,{children:[e.jsx(I,{askAICardLabel:r.askAICardLabel,askAILabel:r.askAILabel,onToggleView:r.onToggleView,shouldShowAskAICard:c}),e.jsx(E,{})]}),e.jsx(A,{})]})})})}function j(r){const{onToggleView:s,askAILabel:t,searchLabel:c}=r,n=d.useCommandState(l=>l.search),{loading:a}=d.useSearch();return e.jsxs(d.EmbeddedSearch.InputGroup,{children:[!a&&e.jsx(d.EmbeddedSearch.InputIcon,{}),e.jsx(d.EmbeddedSearch.Loading,{}),e.jsx(d.EmbeddedSearch.Input,{}),s&&e.jsx(h.WidgetToggle,{onToggleView:s,query:n,askAILabel:t,searchLabel:c,view:"search"}),e.jsx(d.Modal.Close,{})]})}function I(r){const{askAILabel:s,onToggleView:t,shouldShowAskAICard:c,askAICardLabel:n}=r,a=d.useCommandState(S=>S.search),{handleToggle:l}=h.useToggleView({onToggleView:t,query:a});return c?e.jsxs(d.EmbeddedSearch.AskAITrigger,{onSelect:()=>l("chat",!0),children:[e.jsx(d.EmbeddedSearch.AskAITriggerIcon,{}),e.jsxs(d.EmbeddedSearch.AskAITriggerLabel,{children:[n||s||"Ask AI",a&&e.jsx(d.EmbeddedSearch.AskAITriggerQuery,{children:`${a}`})]}),e.jsx(d.EmbeddedSearch.AskAITriggerIndicatorText,{children:"Start conversation"}),e.jsx(d.EmbeddedSearch.AskAITriggerIndicator,{})]}):null}function E(){return e.jsxs(d.EmbeddedSearch.Results,{children:[e.jsx(d.EmbeddedSearch.ResultsLoading,{}),e.jsx(d.EmbeddedSearch.ResultsTabList,{children:r=>r.map(s=>e.jsx(d.EmbeddedSearch.ResultsTab,{tab:s},s))}),e.jsx(d.EmbeddedSearch.ResultsEmpty,{}),e.jsxs(d.EmbeddedSearch.ResultsContent,{children:[e.jsx(g,{}),e.jsx(R,{})]})]})}function g(){return e.jsxs(d.EmbeddedSearch.ResultsScrollArea,{children:[e.jsx(d.EmbeddedSearch.ResultsScrollAreaViewport,{children:e.jsx(d.EmbeddedSearch.ResultsList,{children:r=>r.map(s=>e.jsxs(d.EmbeddedSearch.ResultsItem,{item:s,children:[e.jsx(d.EmbeddedSearch.ResultsItemBreadcrumbs,{children:t=>t.map((c,n)=>e.jsxs(i.Fragment,{children:[c,e.jsx(d.EmbeddedSearch.ResultsItemBreadcrumbIcon,{})]},`${c}-${n}`))}),e.jsx(d.EmbeddedSearch.ResultsItemIcon,{}),e.jsx(d.EmbeddedSearch.ResultsItemTitle,{}),e.jsx(d.EmbeddedSearch.ResultsItemTag,{}),e.jsx(d.EmbeddedSearch.ResultsItemDescription,{children:t=>t.map((c,n)=>e.jsx(d.EmbeddedSearch.ResultsItemDescriptionPart,{part:c},`part-${n}`))}),e.jsx(d.EmbeddedSearch.ResultsItemIndicator,{})]},s.id))})}),e.jsx(d.EmbeddedSearch.ResultsScrollAreaScrollbar,{children:e.jsx(d.EmbeddedSearch.ResultsScrollAreaThumb,{})}),e.jsx(d.EmbeddedSearch.ResultsScrollAreaCorner,{})]})}function R(){return e.jsxs(d.EmbeddedSearch.ResultsScrollArea,{children:[e.jsx(d.EmbeddedSearch.ResultsScrollAreaViewport,{children:e.jsxs(d.EmbeddedSearch.ResultsItemPreview,{children:[e.jsxs(d.EmbeddedSearch.ResultsItemPreviewHeader,{children:[e.jsxs(d.EmbeddedSearch.ResultsItemPreviewHeading,{children:[e.jsx(d.EmbeddedSearch.ResultsItemPreviewTitle,{}),e.jsx(d.EmbeddedSearch.ResultsItemPreviewTitleLinkIcon,{})]}),e.jsx(d.EmbeddedSearch.ResultsItemPreviewBreadcrumbs,{children:r=>r.map((s,t)=>e.jsxs(i.Fragment,{children:[s,e.jsx(d.EmbeddedSearch.ResultsItemPreviewBreadcrumbIcon,{})]},`${s}-${t}`))})]}),e.jsx(d.EmbeddedSearch.ResultsItemPreviewBody,{}),e.jsxs(d.EmbeddedSearch.ResultsItemPreviewOutline,{children:[e.jsx(d.EmbeddedSearch.ResultsItemPreviewOutlineTitle,{}),e.jsx(d.EmbeddedSearch.ResultsItemPreviewOutlineList,{children:r=>r.map((s,t)=>e.jsxs(d.EmbeddedSearch.ResultsItemPreviewOutlineItem,{href:s.url??void 0,"data-is-match":d.dataAttr(s.isMatch),children:[e.jsx(d.EmbeddedSearch.ResultsItemPreviewOutlineItemIcon,{}),e.jsx(d.EmbeddedSearch.ResultsItemPreviewOutlineItemText,{children:s.content}),s.url&&e.jsx(d.EmbeddedSearch.ResultsItemPreviewOutlineItemLinkIcon,{})]},`${s.anchor}-${t}`))})]})]})}),e.jsx(d.EmbeddedSearch.ResultsScrollAreaScrollbar,{children:e.jsx(d.EmbeddedSearch.ResultsScrollAreaThumb,{})}),e.jsx(d.EmbeddedSearch.ResultsScrollAreaCorner,{})]})}function A(){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=x;exports.InkeepEmbeddedSearchImpl=m;exports.InkeepEmbeddedSearchImplContent=u;exports.InkeepEmbeddedSearchProvider=o;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as r, jsxs as s } from "react/jsx-runtime";
|
|
3
|
-
import { ErrorBoundary as m, Shadow as g, RootProvider as R, WebWidgetInteractionType as A, EmbeddedSearch as e, useInkeepConfig as T, useModal as p, useWidget as w, dataAttr as
|
|
4
|
-
import { Fragment as
|
|
5
|
-
import { WidgetToggle as
|
|
6
|
-
import { ModalContent as
|
|
7
|
-
function
|
|
3
|
+
import { ErrorBoundary as m, Shadow as g, RootProvider as R, WebWidgetInteractionType as A, EmbeddedSearch as e, useInkeepConfig as T, useModal as p, useWidget as w, dataAttr as u, useCommandState as I, useSearch as S, Modal as k } from "@inkeep/cxkit-styled";
|
|
4
|
+
import { Fragment as d } from "react";
|
|
5
|
+
import { WidgetToggle as v, useToggleView as b } from "./widget-toggle.js";
|
|
6
|
+
import { ModalContent as P } from "./modal.js";
|
|
7
|
+
function j(t) {
|
|
8
8
|
const { baseSettings: n, searchSettings: l } = t;
|
|
9
9
|
return /* @__PURE__ */ r(m, { children: /* @__PURE__ */ r(g, { children: /* @__PURE__ */ r(
|
|
10
10
|
R,
|
|
@@ -14,31 +14,31 @@ function H(t) {
|
|
|
14
14
|
searchSettings: l
|
|
15
15
|
},
|
|
16
16
|
componentType: A.EmbeddedSearch,
|
|
17
|
-
children: /* @__PURE__ */ r(
|
|
17
|
+
children: /* @__PURE__ */ r(L, { ...t })
|
|
18
18
|
}
|
|
19
19
|
) }) });
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function f(t) {
|
|
22
22
|
const { children: n, onToggleView: l, isHidden: i, shouldAutoFocusInput: o = !l } = t;
|
|
23
23
|
return /* @__PURE__ */ r(e.Provider, { isHidden: i, shouldAutoFocusInput: o, children: n });
|
|
24
24
|
}
|
|
25
|
-
function f(t) {
|
|
26
|
-
return /* @__PURE__ */ r(P, { ...t, children: /* @__PURE__ */ r(L, { ...t }) });
|
|
27
|
-
}
|
|
28
25
|
function L(t) {
|
|
26
|
+
return /* @__PURE__ */ r(f, { ...t, children: /* @__PURE__ */ r(C, { ...t }) });
|
|
27
|
+
}
|
|
28
|
+
function C(t) {
|
|
29
29
|
const {
|
|
30
30
|
searchSettings: { view: n }
|
|
31
31
|
} = T(), { onToggleView: l, shouldShowAskAICard: i = !!l && n !== "dual-pane" } = t, o = p(), c = w();
|
|
32
|
-
return /* @__PURE__ */ r(o && !c ?
|
|
32
|
+
return /* @__PURE__ */ r(o && !c ? P : d, { children: /* @__PURE__ */ r(
|
|
33
33
|
e.Wrapper,
|
|
34
34
|
{
|
|
35
|
-
"data-show-ask-ai-card":
|
|
36
|
-
"data-composite":
|
|
35
|
+
"data-show-ask-ai-card": u(i),
|
|
36
|
+
"data-composite": u(!!l || o?.isOpen),
|
|
37
37
|
children: /* @__PURE__ */ s(e.Root, { children: [
|
|
38
|
-
/* @__PURE__ */ r(
|
|
38
|
+
/* @__PURE__ */ r(V, { ...t }),
|
|
39
39
|
/* @__PURE__ */ s(e.Content, { children: [
|
|
40
40
|
/* @__PURE__ */ r(
|
|
41
|
-
|
|
41
|
+
y,
|
|
42
42
|
{
|
|
43
43
|
askAICardLabel: t.askAICardLabel,
|
|
44
44
|
askAILabel: t.askAILabel,
|
|
@@ -46,21 +46,21 @@ function L(t) {
|
|
|
46
46
|
shouldShowAskAICard: i
|
|
47
47
|
}
|
|
48
48
|
),
|
|
49
|
-
/* @__PURE__ */ r(
|
|
49
|
+
/* @__PURE__ */ r(E, {})
|
|
50
50
|
] }),
|
|
51
|
-
/* @__PURE__ */ r(
|
|
51
|
+
/* @__PURE__ */ r(B, {})
|
|
52
52
|
] })
|
|
53
53
|
}
|
|
54
54
|
) });
|
|
55
55
|
}
|
|
56
|
-
function
|
|
57
|
-
const { onToggleView: n, askAILabel: l, searchLabel: i } = t, o = I((
|
|
56
|
+
function V(t) {
|
|
57
|
+
const { onToggleView: n, askAILabel: l, searchLabel: i } = t, o = I((a) => a.search), { loading: c } = S();
|
|
58
58
|
return /* @__PURE__ */ s(e.InputGroup, { children: [
|
|
59
|
-
/* @__PURE__ */ r(e.InputIcon, {}),
|
|
60
|
-
/* @__PURE__ */ r(e.Input, {}),
|
|
59
|
+
!c && /* @__PURE__ */ r(e.InputIcon, {}),
|
|
61
60
|
/* @__PURE__ */ r(e.Loading, {}),
|
|
61
|
+
/* @__PURE__ */ r(e.Input, {}),
|
|
62
62
|
n && /* @__PURE__ */ r(
|
|
63
|
-
|
|
63
|
+
v,
|
|
64
64
|
{
|
|
65
65
|
onToggleView: n,
|
|
66
66
|
query: o,
|
|
@@ -69,15 +69,15 @@ function C(t) {
|
|
|
69
69
|
view: "search"
|
|
70
70
|
}
|
|
71
71
|
),
|
|
72
|
-
/* @__PURE__ */ r(
|
|
72
|
+
/* @__PURE__ */ r(k.Close, {})
|
|
73
73
|
] });
|
|
74
74
|
}
|
|
75
|
-
function
|
|
76
|
-
const { askAILabel: n, onToggleView: l, shouldShowAskAICard: i, askAICardLabel: o } = t, c = I((h) => h.search), { handleToggle:
|
|
75
|
+
function y(t) {
|
|
76
|
+
const { askAILabel: n, onToggleView: l, shouldShowAskAICard: i, askAICardLabel: o } = t, c = I((h) => h.search), { handleToggle: a } = b({
|
|
77
77
|
onToggleView: l,
|
|
78
78
|
query: c
|
|
79
79
|
});
|
|
80
|
-
return i ? /* @__PURE__ */ s(e.AskAITrigger, { onSelect: () =>
|
|
80
|
+
return i ? /* @__PURE__ */ s(e.AskAITrigger, { onSelect: () => a("chat", !0), children: [
|
|
81
81
|
/* @__PURE__ */ r(e.AskAITriggerIcon, {}),
|
|
82
82
|
/* @__PURE__ */ s(e.AskAITriggerLabel, { children: [
|
|
83
83
|
o || n || "Ask AI",
|
|
@@ -87,21 +87,21 @@ function V(t) {
|
|
|
87
87
|
/* @__PURE__ */ r(e.AskAITriggerIndicator, {})
|
|
88
88
|
] }) : null;
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function E() {
|
|
91
91
|
return /* @__PURE__ */ s(e.Results, { children: [
|
|
92
92
|
/* @__PURE__ */ r(e.ResultsLoading, {}),
|
|
93
93
|
/* @__PURE__ */ r(e.ResultsTabList, { children: (t) => t.map((n) => /* @__PURE__ */ r(e.ResultsTab, { tab: n }, n)) }),
|
|
94
94
|
/* @__PURE__ */ r(e.ResultsEmpty, {}),
|
|
95
95
|
/* @__PURE__ */ s(e.ResultsContent, { children: [
|
|
96
|
-
/* @__PURE__ */ r(
|
|
97
|
-
/* @__PURE__ */ r(
|
|
96
|
+
/* @__PURE__ */ r(O, {}),
|
|
97
|
+
/* @__PURE__ */ r($, {})
|
|
98
98
|
] })
|
|
99
99
|
] });
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function O() {
|
|
102
102
|
return /* @__PURE__ */ s(e.ResultsScrollArea, { children: [
|
|
103
103
|
/* @__PURE__ */ r(e.ResultsScrollAreaViewport, { children: /* @__PURE__ */ r(e.ResultsList, { children: (t) => t.map((n) => /* @__PURE__ */ s(e.ResultsItem, { item: n, children: [
|
|
104
|
-
/* @__PURE__ */ r(e.ResultsItemBreadcrumbs, { children: (l) => l.map((i, o) => /* @__PURE__ */ s(
|
|
104
|
+
/* @__PURE__ */ r(e.ResultsItemBreadcrumbs, { children: (l) => l.map((i, o) => /* @__PURE__ */ s(d, { children: [
|
|
105
105
|
i,
|
|
106
106
|
/* @__PURE__ */ r(e.ResultsItemBreadcrumbIcon, {})
|
|
107
107
|
] }, `${i}-${o}`)) }),
|
|
@@ -121,7 +121,7 @@ function E() {
|
|
|
121
121
|
/* @__PURE__ */ r(e.ResultsScrollAreaCorner, {})
|
|
122
122
|
] });
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function $() {
|
|
125
125
|
return /* @__PURE__ */ s(e.ResultsScrollArea, { children: [
|
|
126
126
|
/* @__PURE__ */ r(e.ResultsScrollAreaViewport, { children: /* @__PURE__ */ s(e.ResultsItemPreview, { children: [
|
|
127
127
|
/* @__PURE__ */ s(e.ResultsItemPreviewHeader, { children: [
|
|
@@ -129,7 +129,7 @@ function O() {
|
|
|
129
129
|
/* @__PURE__ */ r(e.ResultsItemPreviewTitle, {}),
|
|
130
130
|
/* @__PURE__ */ r(e.ResultsItemPreviewTitleLinkIcon, {})
|
|
131
131
|
] }),
|
|
132
|
-
/* @__PURE__ */ r(e.ResultsItemPreviewBreadcrumbs, { children: (t) => t.map((n, l) => /* @__PURE__ */ s(
|
|
132
|
+
/* @__PURE__ */ r(e.ResultsItemPreviewBreadcrumbs, { children: (t) => t.map((n, l) => /* @__PURE__ */ s(d, { children: [
|
|
133
133
|
n,
|
|
134
134
|
/* @__PURE__ */ r(e.ResultsItemPreviewBreadcrumbIcon, {})
|
|
135
135
|
] }, `${n}-${l}`)) })
|
|
@@ -141,7 +141,7 @@ function O() {
|
|
|
141
141
|
e.ResultsItemPreviewOutlineItem,
|
|
142
142
|
{
|
|
143
143
|
href: n.url ?? void 0,
|
|
144
|
-
"data-is-match":
|
|
144
|
+
"data-is-match": u(n.isMatch),
|
|
145
145
|
children: [
|
|
146
146
|
/* @__PURE__ */ r(e.ResultsItemPreviewOutlineItemIcon, {}),
|
|
147
147
|
/* @__PURE__ */ r(e.ResultsItemPreviewOutlineItemText, { children: n.content }),
|
|
@@ -156,7 +156,7 @@ function O() {
|
|
|
156
156
|
/* @__PURE__ */ r(e.ResultsScrollAreaCorner, {})
|
|
157
157
|
] });
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function B() {
|
|
160
160
|
return /* @__PURE__ */ r(e.Footer, { children: /* @__PURE__ */ s(e.TaglineContainer, { children: [
|
|
161
161
|
/* @__PURE__ */ r(e.TaglineText, {}),
|
|
162
162
|
/* @__PURE__ */ r(e.TaglineLogo, {}),
|
|
@@ -164,8 +164,8 @@ function $() {
|
|
|
164
164
|
] }) });
|
|
165
165
|
}
|
|
166
166
|
export {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
167
|
+
j as InkeepEmbeddedSearch,
|
|
168
|
+
L as InkeepEmbeddedSearchImpl,
|
|
169
|
+
C as InkeepEmbeddedSearchImplContent,
|
|
170
|
+
f as InkeepEmbeddedSearchProvider
|
|
171
171
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/cxkit-react",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.94",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Inkeep, Inc. Customer License (IICL) v1.1",
|
|
6
6
|
"homepage": "",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@radix-ui/react-use-controllable-state": "^1.1.0",
|
|
24
24
|
"lucide-react": "^0.503.0",
|
|
25
|
-
"@inkeep/cxkit-styled": "0.5.
|
|
25
|
+
"@inkeep/cxkit-styled": "0.5.94"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@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.5.
|
|
48
|
-
"@inkeep/cxkit-types": "0.5.
|
|
47
|
+
"@inkeep/cxkit-color-mode": "0.5.94",
|
|
48
|
+
"@inkeep/cxkit-types": "0.5.94"
|
|
49
49
|
},
|
|
50
50
|
"module": "dist/index.js",
|
|
51
51
|
"types": "dist/index.d.ts",
|