@inkeep/cxkit-react 0.5.6 → 0.5.9

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 t=require("react/jsx-runtime"),e=require("@inkeep/cxkit-styled"),m=require("react"),g=require("./modal.cjs"),x=require("./embedded-search-and-chat.cjs"),B=require("./embedded-search-and-chat.impl.cjs"),j=require("./embedded-chat.cjs");function I(n){const[r,o]=m.useState(!1),{modalSettings:a,label:i,defaultView:s="chat",canToggleView:p=!0,...c}=n,{config:d,...u}=B.useWidgetImpl({...c,defaultView:s}),C={...a,isOpen:r,onOpenChange:h=>{n.forceDefaultView&&!h&&u.setView(s??"chat"),o(!!h)}};return t.jsxs(t.Fragment,{children:[t.jsx(e.Shadow,{wrapperStyles:{display:"contents"},children:t.jsx(e.RootProvider,{config:d,componentType:e.WebWidgetInteractionType.ChatButton,children:t.jsx(l,{label:i,setOpen:o})})}),t.jsx(g.InkeepModal,{...d,componentType:e.WebWidgetInteractionType.ChatButton,modalSettings:C,children:p?t.jsx(x.InkeepEmbeddedSearchAndChatImpl,{...u}):t.jsx(j.InkeepEmbeddedChatImpl,{...c})})]})}function l(n){const{label:r="Ask AI",setOpen:o}=n;return t.jsx(e.ChatButton.Container,{children:t.jsxs(e.ChatButton.ChatButton,{onPointerDown:a=>{a.button!==2&&(o(i=>!i),a.stopPropagation())},children:[t.jsx(e.ChatButton.ChatButtonText,{children:r}),t.jsx(e.ChatButton.ChatButtonAvatarContent,{children:t.jsx(e.ChatButton.ChatButtonAvatarImage,{})})]})})}exports.ChatButtonImpl=l;exports.InkeepChatButton=I;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),e=require("@inkeep/cxkit-styled"),m=require("react"),g=require("./modal.cjs"),x=require("./embedded-search-and-chat.cjs"),B=require("./embedded-search-and-chat.impl.cjs"),j=require("./embedded-chat.cjs");function I(n){const[a,o]=m.useState(!1),{modalSettings:r,label:i,defaultView:s="chat",canToggleView:p=!0,...c}=n,{config:d,...u}=B.useWidgetImpl({...c,defaultView:s}),C={...r,isOpen:a,onOpenChange:h=>{n.forceDefaultView&&!h&&u.setView(s??"chat"),o(!!h)}};return t.jsxs(t.Fragment,{children:[t.jsx(e.Shadow,{wrapperStyles:{display:"contents"},children:t.jsx(e.RootProvider,{config:d,componentType:e.WebWidgetInteractionType.ChatButton,children:t.jsx(l,{label:i,setOpen:o})})}),t.jsx(g.InkeepModal,{...d,componentType:e.WebWidgetInteractionType.ChatButton,modalSettings:C,children:p?t.jsx(x.InkeepEmbeddedSearchAndChatImpl,{...u}):t.jsx(j.InkeepEmbeddedChatImpl,{...c})})]})}function l(n){const{label:a="Ask AI",setOpen:o}=n;return t.jsx(e.ChatButton.Container,{children:t.jsxs(e.ChatButton.ChatButton,{onClick:r=>{r.button!==2&&o(i=>!i)},children:[t.jsx(e.ChatButton.ChatButtonText,{children:a}),t.jsx(e.ChatButton.ChatButtonAvatarContent,{children:t.jsx(e.ChatButton.ChatButtonAvatarImage,{})})]})})}exports.ChatButtonImpl=l;exports.InkeepChatButton=I;
@@ -2,47 +2,47 @@
2
2
  import { jsxs as s, Fragment as C, jsx as t } from "react/jsx-runtime";
3
3
  import { Shadow as g, RootProvider as I, WebWidgetInteractionType as h, ChatButton as e } from "@inkeep/cxkit-styled";
4
4
  import { useState as B } from "react";
5
- import { InkeepModal as w } from "./modal.js";
6
- import { InkeepEmbeddedSearchAndChatImpl as S } from "./embedded-search-and-chat.js";
7
- import { useWidgetImpl as b } from "./embedded-search-and-chat.impl.js";
8
- import { InkeepEmbeddedChatImpl as k } from "./embedded-chat.js";
9
- function v(n) {
10
- const [a, o] = B(!1), {
11
- modalSettings: r,
5
+ import { InkeepModal as S } from "./modal.js";
6
+ import { InkeepEmbeddedSearchAndChatImpl as b } from "./embedded-search-and-chat.js";
7
+ import { useWidgetImpl as k } from "./embedded-search-and-chat.impl.js";
8
+ import { InkeepEmbeddedChatImpl as w } from "./embedded-chat.js";
9
+ function E(n) {
10
+ const [r, o] = B(!1), {
11
+ modalSettings: a,
12
12
  label: i,
13
- defaultView: p = "chat",
13
+ defaultView: l = "chat",
14
14
  canToggleView: u = !0,
15
- ...l
16
- } = n, { config: m, ...c } = b({ ...l, defaultView: p }), f = {
17
- ...r,
18
- isOpen: a,
15
+ ...c
16
+ } = n, { config: m, ...p } = k({ ...c, defaultView: l }), f = {
17
+ ...a,
18
+ isOpen: r,
19
19
  onOpenChange: (d) => {
20
- n.forceDefaultView && !d && c.setView(p ?? "chat"), o(!!d);
20
+ n.forceDefaultView && !d && p.setView(l ?? "chat"), o(!!d);
21
21
  }
22
22
  };
23
23
  return /* @__PURE__ */ s(C, { children: [
24
24
  /* @__PURE__ */ t(g, { wrapperStyles: { display: "contents" }, children: /* @__PURE__ */ t(I, { config: m, componentType: h.ChatButton, children: /* @__PURE__ */ t(y, { label: i, setOpen: o }) }) }),
25
25
  /* @__PURE__ */ t(
26
- w,
26
+ S,
27
27
  {
28
28
  ...m,
29
29
  componentType: h.ChatButton,
30
30
  modalSettings: f,
31
- children: u ? /* @__PURE__ */ t(S, { ...c }) : /* @__PURE__ */ t(k, { ...l })
31
+ children: u ? /* @__PURE__ */ t(b, { ...p }) : /* @__PURE__ */ t(w, { ...c })
32
32
  }
33
33
  )
34
34
  ] });
35
35
  }
36
36
  function y(n) {
37
- const { label: a = "Ask AI", setOpen: o } = n;
37
+ const { label: r = "Ask AI", setOpen: o } = n;
38
38
  return /* @__PURE__ */ t(e.Container, { children: /* @__PURE__ */ s(
39
39
  e.ChatButton,
40
40
  {
41
- onPointerDown: (r) => {
42
- r.button !== 2 && (o((i) => !i), r.stopPropagation());
41
+ onClick: (a) => {
42
+ a.button !== 2 && o((i) => !i);
43
43
  },
44
44
  children: [
45
- /* @__PURE__ */ t(e.ChatButtonText, { children: a }),
45
+ /* @__PURE__ */ t(e.ChatButtonText, { children: r }),
46
46
  /* @__PURE__ */ t(e.ChatButtonAvatarContent, { children: /* @__PURE__ */ t(e.ChatButtonAvatarImage, {}) })
47
47
  ]
48
48
  }
@@ -50,5 +50,5 @@ function y(n) {
50
50
  }
51
51
  export {
52
52
  y as ChatButtonImpl,
53
- v as InkeepChatButton
53
+ E as InkeepChatButton
54
54
  };
@@ -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"),c=require("react"),i=require("./widget-toggle.cjs");function o(a){const{baseSettings:t,aiChatSettings:s}=a;return e.jsx(d.Shadow,{wrapperStyles:{height:"inherit",width:"inherit"},children:e.jsx(d.RootProvider,{config:{baseSettings:t,aiChatSettings:s},componentType:d.WebWidgetInteractionType.EmbeddedChat,children:e.jsx(r,{...a})})})}function r(a){const{onToggleView:t,isHidden:s,shouldAutoFocusInput:n=!t}=a,h=d.useModal();return e.jsx(d.EmbeddedChat.Provider,{isHidden:s,shouldAutoFocusInput:n,children:e.jsxs(d.EmbeddedChat.Wrapper,{variant:t?"no-shadow":"container-with-shadow","data-composite":d.dataAttr(!!a.onToggleView||h?.isOpen),children:[e.jsx(d.EmbeddedChat.ConversationLoading,{}),e.jsxs(d.EmbeddedChat.Root,{children:[e.jsx(b,{...a}),e.jsx(l,{}),e.jsx(g,{})]}),e.jsx(M,{}),e.jsx(I,{})]})})}function b(a){const{onToggleView:t,askAILabel:s,searchLabel:n}=a,h=!!t;return e.jsxs(d.EmbeddedChat.Header,{"data-show-toolbar":d.dataAttr(h),children:[h&&e.jsxs(d.EmbeddedChat.HeaderToolbar,{children:[e.jsxs(d.EmbeddedChat.HeaderToolbarWrapper,{children:[e.jsx(d.EmbeddedChat.ToolbarHeader,{}),e.jsxs(d.EmbeddedChat.Disclaimer,{children:[e.jsx(d.EmbeddedChat.DisclaimerTrigger,{}),e.jsxs(d.EmbeddedChat.DisclaimerContent,{side:"bottom",align:"start",children:[e.jsx(d.EmbeddedChat.DisclaimerText,{}),e.jsx(d.EmbeddedChat.DisclaimerArrow,{})]})]})]}),e.jsx(i.WidgetToggle,{onToggleView:t,askAILabel:s,searchLabel:n,view:"chat"})]}),e.jsx(d.Modal.Close,{})]})}function l(){return e.jsx(d.EmbeddedChat.Content,{children:e.jsxs(d.EmbeddedChat.ContentScrollArea,{children:[e.jsx(d.EmbeddedChat.ContentScrollAreaViewport,{children:e.jsx(C,{})}),e.jsx(d.EmbeddedChat.ContentScrollAreaScrollbar,{children:e.jsx(d.EmbeddedChat.ContentScrollAreaThumb,{})}),e.jsx(d.EmbeddedChat.ContentScrollAreaCorner,{})]})})}function C(){return e.jsx(d.EmbeddedChat.Messages,{children:({messages:a})=>e.jsxs(e.Fragment,{children:[e.jsx(x,{}),a.map(t=>e.jsxs(d.EmbeddedChat.MessageWrapper,{message:t,children:[e.jsx(j,{}),e.jsx(d.EmbeddedChat.MessageLoading,{}),e.jsxs(d.EmbeddedChat.MessageContentWrapper,{children:[e.jsx(d.EmbeddedChat.MessageContent,{children:e.jsx(d.EmbeddedChat.Message,{})}),e.jsx(E,{}),e.jsx(u,{}),e.jsx(F,{})]})]},t.id))]})})}function x(){return e.jsxs(d.EmbeddedChat.IntroMessageWrapper,{children:[e.jsxs(d.EmbeddedChat.MessageHeader,{children:[e.jsx(d.EmbeddedChat.MessageAvatar,{children:e.jsxs(d.EmbeddedChat.MessageAvatarContent,{children:[e.jsx(d.EmbeddedChat.MessageAvatarFallback,{}),e.jsx(d.EmbeddedChat.MessageAvatarImage,{})]})}),e.jsx(d.EmbeddedChat.MessageName,{})]}),e.jsxs(d.EmbeddedChat.MessageContentWrapper,{children:[e.jsx(d.EmbeddedChat.MessageContent,{children:e.jsx(d.EmbeddedChat.Message,{})}),e.jsxs(d.EmbeddedChat.Disclaimer,{children:[e.jsx(d.EmbeddedChat.DisclaimerLabel,{}),e.jsx(d.EmbeddedChat.DisclaimerTrigger,{}),e.jsxs(d.EmbeddedChat.DisclaimerContent,{children:[e.jsx(d.EmbeddedChat.DisclaimerText,{}),e.jsx(d.EmbeddedChat.DisclaimerArrow,{})]})]}),e.jsxs(d.EmbeddedChat.QuickQuestions,{children:[e.jsx(d.EmbeddedChat.QuickQuestionsLabel,{}),e.jsx(d.EmbeddedChat.QuickQuestionsList,{children:a=>a.map(t=>e.jsx(d.EmbeddedChat.QuickQuestion,{children:e.jsx(d.EmbeddedChat.QuickQuestionButton,{question:t})},t))})]})]})]})}function j(){return e.jsxs(d.EmbeddedChat.MessageHeader,{children:[e.jsx(d.EmbeddedChat.MessageAvatar,{children:e.jsxs(d.EmbeddedChat.MessageAvatarContent,{children:[e.jsx(d.EmbeddedChat.MessageAvatarFallback,{}),e.jsx(d.EmbeddedChat.MessageAvatarImage,{})]})}),e.jsx(d.EmbeddedChat.MessageName,{})]})}function E(){return e.jsxs(d.EmbeddedChat.MessageAttachments,{children:[e.jsx(d.EmbeddedChat.MessageAttachmentsList,{children:a=>a.map(t=>e.jsxs(d.EmbeddedChat.MessageAttachmentsItem,{attachment:t,children:[e.jsx(d.EmbeddedChat.MessageAttachmentsItemIcon,{}),e.jsx(d.EmbeddedChat.MessageAttachmentsItemTitle,{})]},t.id))}),e.jsx(d.EmbeddedChat.MessageAttachmentsPreview,{children:e.jsx(d.PortalWithTheme,{children:e.jsx(d.EmbeddedChat.MessageAttachmentsPreviewOverlay,{children:e.jsxs(d.EmbeddedChat.MessageAttachmentsPreviewContent,{children:[e.jsx(d.EmbeddedChat.MessageAttachmentsPreviewHeader,{}),e.jsx(d.EmbeddedChat.MessageAttachmentsPreviewClose,{}),e.jsx(d.EmbeddedChat.MessageAttachmentsPreviewBody,{})]})})})})]})}function u(){return e.jsxs(d.EmbeddedChat.MessageActions,{children:[e.jsx(d.EmbeddedChat.MessageToolActions,{children:a=>a.map((t,s)=>e.jsx(d.EmbeddedChat.MessageToolAction,{action:t},`action-${s}`))}),e.jsx(d.EmbeddedChat.MessageAction,{action:"copy"}),e.jsx(d.EmbeddedChat.MessageAction,{action:"upvote"}),e.jsx(d.EmbeddedChat.MessageAction,{action:"downvote"})]})}function F(){return e.jsxs(d.EmbeddedChat.MessageSources,{children:[e.jsx(d.EmbeddedChat.MessageSourcesHeader,{}),e.jsx(d.EmbeddedChat.MessageSourcesList,{children:a=>a.map((t,s)=>e.jsxs(d.EmbeddedChat.MessageSourceItem,{href:t.url,source:t,children:[e.jsx(d.EmbeddedChat.MessageSourceItemBreadcrumbs,{children:t.breadcrumbs?.map(n=>e.jsxs(c.Fragment,{children:[n,e.jsx(d.EmbeddedChat.MessageSourceItemBreadcrumbIcon,{})]},n))}),e.jsx(d.EmbeddedChat.MessageSourceItemIcon,{}),e.jsx(d.EmbeddedChat.MessageSourceItemTitle,{}),e.jsx(d.EmbeddedChat.MessageSourceItemTag,{}),e.jsx(d.EmbeddedChat.MessageSourceItemDescription,{children:n=>n.map((h,m)=>e.jsx(d.EmbeddedChat.MessageSourceItemDescriptionPart,{part:h},`part-${m}`))}),e.jsx(d.EmbeddedChat.MessageSourceItemIndicator,{})]},s))})]})}function g(){return e.jsxs(d.EmbeddedChat.Footer,{children:[e.jsx(A,{}),e.jsx(p,{})]})}function A(){return e.jsxs(d.EmbeddedChat.InputFieldset,{children:[e.jsxs(d.EmbeddedChat.InputGroup,{children:[e.jsx(d.EmbeddedChat.Input,{}),e.jsx(d.EmbeddedChat.SendButton,{children:e.jsx(d.EmbeddedChat.SendButtonIcon,{})})]}),e.jsxs(d.EmbeddedChat.AttachmentsBar,{children:[e.jsx(d.EmbeddedChat.AttachmentsBarList,{children:a=>a.map(t=>e.jsxs(d.EmbeddedChat.AttachmentsBarAttachment,{attachment:t,children:[e.jsx(d.EmbeddedChat.AttachmentsBarAttachmentIcon,{}),e.jsx(d.EmbeddedChat.AttachmentsBarAttachmentTitle,{}),e.jsx(d.EmbeddedChat.AttachmentsBarAttachmentDelete,{})]},t.id))}),e.jsxs(d.EmbeddedChat.AttachmentsBarActions,{children:[e.jsxs(d.EmbeddedChat.AttachmentsBarInfoTip,{children:[e.jsx(d.EmbeddedChat.AttachmentsBarInfoTipIcon,{}),e.jsx(d.EmbeddedChat.AttachmentsBarInfoTipText,{})]}),e.jsx(d.EmbeddedChat.AttachmentsBarInputs,{children:a=>a.map(t=>e.jsxs(d.EmbeddedChat.AttachmentsBarInput,{input:t,children:[e.jsx(d.EmbeddedChat.AttachmentsBarInputIcon,{}),t.displayName]},t.id))})]}),e.jsx(d.PortalWithTheme,{children:e.jsx(d.EmbeddedChat.AttachmentsBarModal,{children:e.jsx(d.EmbeddedChat.AttachmentsBarModalOverlay,{children:e.jsxs(d.EmbeddedChat.AttachmentsBarModalContent,{children:[e.jsxs(d.EmbeddedChat.AttachmentsBarModalHeader,{children:[e.jsx(d.EmbeddedChat.AttachmentsBarModalHeading,{}),e.jsx(d.EmbeddedChat.AttachmentsBarModalDescription,{}),e.jsx(d.EmbeddedChat.AttachmentsBarModalHelp,{})]}),e.jsx(d.EmbeddedChat.AttachmentsBarModalClose,{}),e.jsx(d.EmbeddedChat.AttachmentsBarModalBody,{children:e.jsxs(d.EmbeddedChat.AttachmentsBarForm,{children:[e.jsxs(d.EmbeddedChat.AttachmentsBarFormTitle,{children:[e.jsx(d.EmbeddedChat.AttachmentsBarFormTitleLabel,{}),e.jsx(d.EmbeddedChat.AttachmentsBarFormTitleInput,{}),e.jsx(d.EmbeddedChat.AttachmentsBarFormTitleError,{})]}),e.jsxs(d.EmbeddedChat.AttachmentsBarFormContent,{children:[e.jsx(d.EmbeddedChat.AttachmentsBarFormContentLabel,{}),e.jsx(d.EmbeddedChat.AttachmentsBarFormContentInput,{}),e.jsx(d.EmbeddedChat.AttachmentsBarFormContentError,{})]}),e.jsx(d.EmbeddedChat.AttachmentsBarFormSubmitButton,{})]})})]})})})})]})]})}function p(){return e.jsxs(d.EmbeddedChat.ActionBar,{children:[e.jsxs(d.EmbeddedChat.TaglineContainer,{children:[e.jsx(d.EmbeddedChat.TaglineText,{}),e.jsx(d.EmbeddedChat.TaglineLogo,{}),e.jsx(d.EmbeddedChat.TaglineBrandName,{})]}),e.jsxs(d.EmbeddedChat.Actions,{children:[e.jsx(d.EmbeddedChat.HelpActions,{children:({pinned:a,unpinned:t})=>e.jsxs(e.Fragment,{children:[a.map(s=>e.jsx(d.EmbeddedChat.HelpAction,{action:s},s.name)),t.length>0&&e.jsx(d.EmbeddedChat.HelpActionsTrigger,{}),e.jsxs(d.EmbeddedChat.HelpActionsMenu,{children:[e.jsx(d.EmbeddedChat.HelpActionsMenuArrow,{}),t.map(s=>e.jsxs(d.EmbeddedChat.HelpActionsMenuItem,{action:s,children:[e.jsx(d.EmbeddedChat.HelpActionsMenuItemIcon,{action:s}),s.name]},s.name))]})]})}),e.jsxs(d.EmbeddedChat.ChatAction,{action:"copy",children:[e.jsx(d.EmbeddedChat.ChatActionLabel,{action:"copy"}),e.jsx(d.EmbeddedChat.ChatActionFeedback,{action:"copy"})]}),e.jsxs(d.EmbeddedChat.ChatAction,{action:"share",children:[e.jsx(d.EmbeddedChat.ChatActionLabel,{action:"share"}),e.jsx(d.EmbeddedChat.ChatActionFeedback,{action:"share"})]}),e.jsx(d.EmbeddedChat.ChatAction,{action:"clear"}),e.jsx(d.EmbeddedChat.ChatAction,{action:"stop"})]})]})}function M(){return e.jsx(d.PortalWithTheme,{children:e.jsx(d.EmbeddedChat.FeedbackModal,{children:e.jsx(d.EmbeddedChat.FeedbackModalOverlay,{children:e.jsxs(d.EmbeddedChat.FeedbackModalContent,{children:[e.jsx(d.EmbeddedChat.FeedbackModalHeader,{}),e.jsx(d.EmbeddedChat.FeedbackModalClose,{}),e.jsx(d.EmbeddedChat.FeedbackModalBody,{children:e.jsxs(d.EmbeddedChat.FeedbackForm,{children:[e.jsxs(d.EmbeddedChat.FeedbackItem,{name:"unrelated_response",children:[e.jsx(d.EmbeddedChat.FeedbackItemCheckbox,{children:e.jsx(d.EmbeddedChat.FeedbackItemCheckboxIndicator,{})}),e.jsx(d.EmbeddedChat.FeedbackItemLabel,{}),e.jsx(d.EmbeddedChat.FeedbackItemDescription,{})]}),e.jsxs(d.EmbeddedChat.FeedbackItem,{name:"inaccurate_statement",children:[e.jsx(d.EmbeddedChat.FeedbackItemCheckbox,{children:e.jsx(d.EmbeddedChat.FeedbackItemCheckboxIndicator,{})}),e.jsx(d.EmbeddedChat.FeedbackItemLabel,{}),e.jsx(d.EmbeddedChat.FeedbackItemDescription,{})]}),e.jsxs(d.EmbeddedChat.FeedbackItem,{name:"inaccurate_code_snippet",children:[e.jsx(d.EmbeddedChat.FeedbackItemCheckbox,{children:e.jsx(d.EmbeddedChat.FeedbackItemCheckboxIndicator,{})}),e.jsx(d.EmbeddedChat.FeedbackItemLabel,{}),e.jsx(d.EmbeddedChat.FeedbackItemDescription,{})]}),e.jsxs(d.EmbeddedChat.FeedbackItem,{name:"irrelevant_citations",children:[e.jsx(d.EmbeddedChat.FeedbackItemCheckbox,{children:e.jsx(d.EmbeddedChat.FeedbackItemCheckboxIndicator,{})}),e.jsx(d.EmbeddedChat.FeedbackItemLabel,{})]}),e.jsx(d.EmbeddedChat.FeedbackSubmitButton,{})]})})]})})})})}function I(){return e.jsxs(d.EmbeddedChat.FormWrapper,{children:[e.jsx(d.EmbeddedChat.FormClose,{}),e.jsxs(d.EmbeddedChat.Form,{children:[e.jsxs(d.EmbeddedChat.FormHeader,{children:[e.jsx(d.EmbeddedChat.FormHeading,{}),e.jsx(d.EmbeddedChat.FormDescription,{})]}),e.jsx(d.EmbeddedChat.FormContent,{children:a=>e.jsxs(e.Fragment,{children:[a.map((t,s)=>e.jsxs(d.EmbeddedChat.FormField,{field:t,autoFocus:s===0,children:[e.jsx(d.EmbeddedChat.FormFieldLabel,{}),t.inputType==="text"&&e.jsx(d.EmbeddedChat.FormFieldText,{}),t.inputType==="email"&&e.jsx(d.EmbeddedChat.FormFieldEmail,{}),t.inputType==="file"&&e.jsx(d.EmbeddedChat.FormFieldFile,{}),t.inputType==="textarea"&&e.jsx(d.EmbeddedChat.FormFieldTextArea,{}),t.inputType==="checkbox"&&e.jsx(d.EmbeddedChat.FormFieldCheckbox,{children:e.jsx(d.EmbeddedChat.FormFieldCheckboxIndicator,{})}),t.inputType==="select"&&e.jsxs(d.EmbeddedChat.FormFieldSelect,{children:[e.jsxs(d.EmbeddedChat.FormFieldSelectTrigger,{children:[e.jsx(d.EmbeddedChat.FormFieldSelectValue,{}),e.jsx(d.EmbeddedChat.FormFieldSelectIcon,{})]}),e.jsx(d.EmbeddedChat.FormFieldSelectContent,{children:e.jsx(d.EmbeddedChat.FormFieldSelectViewport,{children:t.items.map(n=>e.jsxs(d.EmbeddedChat.FormFieldSelectItem,{value:n.value,children:[e.jsx(d.EmbeddedChat.FormFieldSelectItemText,{children:n.label}),e.jsx(d.EmbeddedChat.FormFieldSelectItemIndicator,{})]},n.value))})})]}),e.jsx(d.EmbeddedChat.FormFieldError,{})]},t.name)),e.jsx(d.EmbeddedChat.FormError,{})]})}),e.jsxs(d.EmbeddedChat.FormFooter,{children:[e.jsx(d.EmbeddedChat.FormCancel,{}),e.jsx(d.EmbeddedChat.FormSubmit,{})]})]}),e.jsxs(d.EmbeddedChat.FormSuccess,{children:[e.jsx(d.EmbeddedChat.FormSuccessHeading,{}),e.jsx(d.EmbeddedChat.FormSuccessMessage,{}),e.jsx(d.EmbeddedChat.FormSuccessButton,{})]})]})}exports.InkeepEmbeddedChat=o;exports.InkeepEmbeddedChatImpl=r;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("@inkeep/cxkit-styled"),h=require("react"),b=require("./widget-toggle.cjs"),C=require("./modal.cjs");function l(a){const{baseSettings:t,aiChatSettings:s}=a;return e.jsx(d.Shadow,{wrapperStyles:{height:"inherit",width:"inherit"},children:e.jsx(d.RootProvider,{config:{baseSettings:t,aiChatSettings:s},componentType:d.WebWidgetInteractionType.EmbeddedChat,children:e.jsx(c,{...a})})})}function m(a){const{children:t,onToggleView:s,isHidden:n,shouldAutoFocusInput:r=!s}=a;return e.jsx(d.EmbeddedChat.Provider,{isHidden:n,shouldAutoFocusInput:r,children:t})}function c(a){return e.jsx(m,{...a,children:e.jsx(i,{...a})})}function i(a){const{onToggleView:t}=a,s=d.useModal(),n=d.useWidget(),r=s&&!n?C.ModalContent:h.Fragment;return e.jsx(r,{children:e.jsxs(d.EmbeddedChat.Wrapper,{variant:t?"no-shadow":"container-with-shadow","data-composite":d.dataAttr(!!a.onToggleView||s?.isOpen),children:[e.jsx(d.EmbeddedChat.ConversationLoading,{}),e.jsxs(d.EmbeddedChat.Root,{children:[e.jsx(x,{...a}),e.jsx(j,{}),e.jsx(I,{})]}),e.jsx(T,{}),e.jsx(B,{})]})})}function x(a){const{onToggleView:t,askAILabel:s,searchLabel:n}=a,r=!!t;return e.jsxs(d.EmbeddedChat.Header,{"data-show-toolbar":d.dataAttr(r),children:[r&&e.jsxs(d.EmbeddedChat.HeaderToolbar,{children:[e.jsxs(d.EmbeddedChat.HeaderToolbarWrapper,{children:[e.jsx(d.EmbeddedChat.ToolbarHeader,{}),e.jsxs(d.EmbeddedChat.Disclaimer,{children:[e.jsx(d.EmbeddedChat.DisclaimerTrigger,{}),e.jsxs(d.EmbeddedChat.DisclaimerContent,{side:"bottom",align:"start",children:[e.jsx(d.EmbeddedChat.DisclaimerText,{}),e.jsx(d.EmbeddedChat.DisclaimerArrow,{})]})]})]}),e.jsx(b.WidgetToggle,{onToggleView:t,askAILabel:s,searchLabel:n,view:"chat"})]}),e.jsx(d.Modal.Close,{})]})}function j(){return e.jsx(d.EmbeddedChat.Content,{children:e.jsxs(d.EmbeddedChat.ContentScrollArea,{children:[e.jsx(d.EmbeddedChat.ContentScrollAreaViewport,{children:e.jsx(E,{})}),e.jsx(d.EmbeddedChat.ContentScrollAreaScrollbar,{children:e.jsx(d.EmbeddedChat.ContentScrollAreaThumb,{})}),e.jsx(d.EmbeddedChat.ContentScrollAreaCorner,{})]})})}function E(){return e.jsx(d.EmbeddedChat.Messages,{children:({messages:a})=>e.jsxs(e.Fragment,{children:[e.jsx(u,{}),a.map(t=>e.jsxs(d.EmbeddedChat.MessageWrapper,{message:t,children:[e.jsx(F,{}),e.jsx(d.EmbeddedChat.MessageLoading,{}),e.jsxs(d.EmbeddedChat.MessageContentWrapper,{children:[e.jsx(d.EmbeddedChat.MessageContent,{children:e.jsx(d.EmbeddedChat.Message,{})}),e.jsx(g,{}),e.jsx(A,{}),e.jsx(p,{})]})]},t.id))]})})}function u(){return e.jsxs(d.EmbeddedChat.IntroMessageWrapper,{children:[e.jsxs(d.EmbeddedChat.MessageHeader,{children:[e.jsx(d.EmbeddedChat.MessageAvatar,{children:e.jsxs(d.EmbeddedChat.MessageAvatarContent,{children:[e.jsx(d.EmbeddedChat.MessageAvatarFallback,{}),e.jsx(d.EmbeddedChat.MessageAvatarImage,{})]})}),e.jsx(d.EmbeddedChat.MessageName,{})]}),e.jsxs(d.EmbeddedChat.MessageContentWrapper,{children:[e.jsx(d.EmbeddedChat.MessageContent,{children:e.jsx(d.EmbeddedChat.Message,{})}),e.jsxs(d.EmbeddedChat.Disclaimer,{children:[e.jsx(d.EmbeddedChat.DisclaimerLabel,{}),e.jsx(d.EmbeddedChat.DisclaimerTrigger,{}),e.jsxs(d.EmbeddedChat.DisclaimerContent,{children:[e.jsx(d.EmbeddedChat.DisclaimerText,{}),e.jsx(d.EmbeddedChat.DisclaimerArrow,{})]})]}),e.jsxs(d.EmbeddedChat.QuickQuestions,{children:[e.jsx(d.EmbeddedChat.QuickQuestionsLabel,{}),e.jsx(d.EmbeddedChat.QuickQuestionsList,{children:a=>a.map(t=>e.jsx(d.EmbeddedChat.QuickQuestion,{children:e.jsx(d.EmbeddedChat.QuickQuestionButton,{question:t})},t))})]})]})]})}function F(){return e.jsxs(d.EmbeddedChat.MessageHeader,{children:[e.jsx(d.EmbeddedChat.MessageAvatar,{children:e.jsxs(d.EmbeddedChat.MessageAvatarContent,{children:[e.jsx(d.EmbeddedChat.MessageAvatarFallback,{}),e.jsx(d.EmbeddedChat.MessageAvatarImage,{})]})}),e.jsx(d.EmbeddedChat.MessageName,{})]})}function g(){return e.jsxs(d.EmbeddedChat.MessageAttachments,{children:[e.jsx(d.EmbeddedChat.MessageAttachmentsList,{children:a=>a.map(t=>e.jsxs(d.EmbeddedChat.MessageAttachmentsItem,{attachment:t,children:[e.jsx(d.EmbeddedChat.MessageAttachmentsItemIcon,{}),e.jsx(d.EmbeddedChat.MessageAttachmentsItemTitle,{})]},t.id))}),e.jsx(d.EmbeddedChat.MessageAttachmentsPreview,{children:e.jsx(d.PortalWithTheme,{children:e.jsx(d.EmbeddedChat.MessageAttachmentsPreviewOverlay,{children:e.jsxs(d.EmbeddedChat.MessageAttachmentsPreviewContent,{children:[e.jsx(d.EmbeddedChat.MessageAttachmentsPreviewHeader,{}),e.jsx(d.EmbeddedChat.MessageAttachmentsPreviewClose,{}),e.jsx(d.EmbeddedChat.MessageAttachmentsPreviewBody,{})]})})})})]})}function A(){return e.jsxs(d.EmbeddedChat.MessageActions,{children:[e.jsx(d.EmbeddedChat.MessageToolActions,{children:a=>a.map((t,s)=>e.jsx(d.EmbeddedChat.MessageToolAction,{action:t},`action-${s}`))}),e.jsx(d.EmbeddedChat.MessageAction,{action:"copy"}),e.jsx(d.EmbeddedChat.MessageAction,{action:"upvote"}),e.jsx(d.EmbeddedChat.MessageAction,{action:"downvote"})]})}function p(){return e.jsxs(d.EmbeddedChat.MessageSources,{children:[e.jsx(d.EmbeddedChat.MessageSourcesHeader,{}),e.jsx(d.EmbeddedChat.MessageSourcesList,{children:a=>a.map((t,s)=>e.jsxs(d.EmbeddedChat.MessageSourceItem,{href:t.url,source:t,children:[e.jsx(d.EmbeddedChat.MessageSourceItemBreadcrumbs,{children:t.breadcrumbs?.map(n=>e.jsxs(h.Fragment,{children:[n,e.jsx(d.EmbeddedChat.MessageSourceItemBreadcrumbIcon,{})]},n))}),e.jsx(d.EmbeddedChat.MessageSourceItemIcon,{}),e.jsx(d.EmbeddedChat.MessageSourceItemTitle,{}),e.jsx(d.EmbeddedChat.MessageSourceItemTag,{}),e.jsx(d.EmbeddedChat.MessageSourceItemDescription,{children:n=>n.map((r,o)=>e.jsx(d.EmbeddedChat.MessageSourceItemDescriptionPart,{part:r},`part-${o}`))}),e.jsx(d.EmbeddedChat.MessageSourceItemIndicator,{})]},s))})]})}function I(){return e.jsxs(d.EmbeddedChat.Footer,{children:[e.jsx(M,{}),e.jsx(k,{})]})}function M(){return e.jsxs(d.EmbeddedChat.InputFieldset,{children:[e.jsxs(d.EmbeddedChat.InputGroup,{children:[e.jsx(d.EmbeddedChat.Input,{}),e.jsx(d.EmbeddedChat.SendButton,{children:e.jsx(d.EmbeddedChat.SendButtonIcon,{})})]}),e.jsxs(d.EmbeddedChat.AttachmentsBar,{children:[e.jsx(d.EmbeddedChat.AttachmentsBarList,{children:a=>a.map(t=>e.jsxs(d.EmbeddedChat.AttachmentsBarAttachment,{attachment:t,children:[e.jsx(d.EmbeddedChat.AttachmentsBarAttachmentIcon,{}),e.jsx(d.EmbeddedChat.AttachmentsBarAttachmentTitle,{}),e.jsx(d.EmbeddedChat.AttachmentsBarAttachmentDelete,{})]},t.id))}),e.jsxs(d.EmbeddedChat.AttachmentsBarActions,{children:[e.jsxs(d.EmbeddedChat.AttachmentsBarInfoTip,{children:[e.jsx(d.EmbeddedChat.AttachmentsBarInfoTipIcon,{}),e.jsx(d.EmbeddedChat.AttachmentsBarInfoTipText,{})]}),e.jsx(d.EmbeddedChat.AttachmentsBarInputs,{children:a=>a.map(t=>e.jsxs(d.EmbeddedChat.AttachmentsBarInput,{input:t,children:[e.jsx(d.EmbeddedChat.AttachmentsBarInputIcon,{}),t.displayName]},t.id))})]}),e.jsx(d.PortalWithTheme,{children:e.jsx(d.EmbeddedChat.AttachmentsBarModal,{children:e.jsx(d.EmbeddedChat.AttachmentsBarModalOverlay,{children:e.jsxs(d.EmbeddedChat.AttachmentsBarModalContent,{children:[e.jsxs(d.EmbeddedChat.AttachmentsBarModalHeader,{children:[e.jsx(d.EmbeddedChat.AttachmentsBarModalHeading,{}),e.jsx(d.EmbeddedChat.AttachmentsBarModalDescription,{}),e.jsx(d.EmbeddedChat.AttachmentsBarModalHelp,{})]}),e.jsx(d.EmbeddedChat.AttachmentsBarModalClose,{}),e.jsx(d.EmbeddedChat.AttachmentsBarModalBody,{children:e.jsxs(d.EmbeddedChat.AttachmentsBarForm,{children:[e.jsxs(d.EmbeddedChat.AttachmentsBarFormTitle,{children:[e.jsx(d.EmbeddedChat.AttachmentsBarFormTitleLabel,{}),e.jsx(d.EmbeddedChat.AttachmentsBarFormTitleInput,{}),e.jsx(d.EmbeddedChat.AttachmentsBarFormTitleError,{})]}),e.jsxs(d.EmbeddedChat.AttachmentsBarFormContent,{children:[e.jsx(d.EmbeddedChat.AttachmentsBarFormContentLabel,{}),e.jsx(d.EmbeddedChat.AttachmentsBarFormContentInput,{}),e.jsx(d.EmbeddedChat.AttachmentsBarFormContentError,{})]}),e.jsx(d.EmbeddedChat.AttachmentsBarFormSubmitButton,{})]})})]})})})})]})]})}function k(){return e.jsxs(d.EmbeddedChat.ActionBar,{children:[e.jsxs(d.EmbeddedChat.TaglineContainer,{children:[e.jsx(d.EmbeddedChat.TaglineText,{}),e.jsx(d.EmbeddedChat.TaglineLogo,{}),e.jsx(d.EmbeddedChat.TaglineBrandName,{})]}),e.jsxs(d.EmbeddedChat.Actions,{children:[e.jsx(d.EmbeddedChat.HelpActions,{children:({pinned:a,unpinned:t})=>e.jsxs(e.Fragment,{children:[a.map(s=>e.jsx(d.EmbeddedChat.HelpAction,{action:s},s.name)),t.length>0&&e.jsx(d.EmbeddedChat.HelpActionsTrigger,{}),e.jsxs(d.EmbeddedChat.HelpActionsMenu,{children:[e.jsx(d.EmbeddedChat.HelpActionsMenuArrow,{}),t.map(s=>e.jsxs(d.EmbeddedChat.HelpActionsMenuItem,{action:s,children:[e.jsx(d.EmbeddedChat.HelpActionsMenuItemIcon,{action:s}),s.name]},s.name))]})]})}),e.jsxs(d.EmbeddedChat.ChatAction,{action:"copy",children:[e.jsx(d.EmbeddedChat.ChatActionLabel,{action:"copy"}),e.jsx(d.EmbeddedChat.ChatActionFeedback,{action:"copy"})]}),e.jsxs(d.EmbeddedChat.ChatAction,{action:"share",children:[e.jsx(d.EmbeddedChat.ChatActionLabel,{action:"share"}),e.jsx(d.EmbeddedChat.ChatActionFeedback,{action:"share"})]}),e.jsx(d.EmbeddedChat.ChatAction,{action:"clear"}),e.jsx(d.EmbeddedChat.ChatAction,{action:"stop"})]})]})}function T(){return e.jsx(d.PortalWithTheme,{children:e.jsx(d.EmbeddedChat.FeedbackModal,{children:e.jsx(d.EmbeddedChat.FeedbackModalOverlay,{children:e.jsxs(d.EmbeddedChat.FeedbackModalContent,{children:[e.jsx(d.EmbeddedChat.FeedbackModalHeader,{}),e.jsx(d.EmbeddedChat.FeedbackModalClose,{}),e.jsx(d.EmbeddedChat.FeedbackModalBody,{children:e.jsxs(d.EmbeddedChat.FeedbackForm,{children:[e.jsxs(d.EmbeddedChat.FeedbackItem,{name:"unrelated_response",children:[e.jsx(d.EmbeddedChat.FeedbackItemCheckbox,{children:e.jsx(d.EmbeddedChat.FeedbackItemCheckboxIndicator,{})}),e.jsx(d.EmbeddedChat.FeedbackItemLabel,{}),e.jsx(d.EmbeddedChat.FeedbackItemDescription,{})]}),e.jsxs(d.EmbeddedChat.FeedbackItem,{name:"inaccurate_statement",children:[e.jsx(d.EmbeddedChat.FeedbackItemCheckbox,{children:e.jsx(d.EmbeddedChat.FeedbackItemCheckboxIndicator,{})}),e.jsx(d.EmbeddedChat.FeedbackItemLabel,{}),e.jsx(d.EmbeddedChat.FeedbackItemDescription,{})]}),e.jsxs(d.EmbeddedChat.FeedbackItem,{name:"inaccurate_code_snippet",children:[e.jsx(d.EmbeddedChat.FeedbackItemCheckbox,{children:e.jsx(d.EmbeddedChat.FeedbackItemCheckboxIndicator,{})}),e.jsx(d.EmbeddedChat.FeedbackItemLabel,{}),e.jsx(d.EmbeddedChat.FeedbackItemDescription,{})]}),e.jsxs(d.EmbeddedChat.FeedbackItem,{name:"irrelevant_citations",children:[e.jsx(d.EmbeddedChat.FeedbackItemCheckbox,{children:e.jsx(d.EmbeddedChat.FeedbackItemCheckboxIndicator,{})}),e.jsx(d.EmbeddedChat.FeedbackItemLabel,{})]}),e.jsx(d.EmbeddedChat.FeedbackSubmitButton,{})]})})]})})})})}function B(){return e.jsxs(d.EmbeddedChat.FormWrapper,{children:[e.jsx(d.EmbeddedChat.FormClose,{}),e.jsxs(d.EmbeddedChat.Form,{children:[e.jsxs(d.EmbeddedChat.FormHeader,{children:[e.jsx(d.EmbeddedChat.FormHeading,{}),e.jsx(d.EmbeddedChat.FormDescription,{})]}),e.jsx(d.EmbeddedChat.FormContent,{children:a=>e.jsxs(e.Fragment,{children:[a.map((t,s)=>e.jsxs(d.EmbeddedChat.FormField,{field:t,autoFocus:s===0,children:[e.jsx(d.EmbeddedChat.FormFieldLabel,{}),t.inputType==="text"&&e.jsx(d.EmbeddedChat.FormFieldText,{}),t.inputType==="email"&&e.jsx(d.EmbeddedChat.FormFieldEmail,{}),t.inputType==="file"&&e.jsx(d.EmbeddedChat.FormFieldFile,{}),t.inputType==="textarea"&&e.jsx(d.EmbeddedChat.FormFieldTextArea,{}),t.inputType==="checkbox"&&e.jsx(d.EmbeddedChat.FormFieldCheckbox,{children:e.jsx(d.EmbeddedChat.FormFieldCheckboxIndicator,{})}),t.inputType==="select"&&e.jsxs(d.EmbeddedChat.FormFieldSelect,{children:[e.jsxs(d.EmbeddedChat.FormFieldSelectTrigger,{children:[e.jsx(d.EmbeddedChat.FormFieldSelectValue,{}),e.jsx(d.EmbeddedChat.FormFieldSelectIcon,{})]}),e.jsx(d.EmbeddedChat.FormFieldSelectContent,{children:e.jsx(d.EmbeddedChat.FormFieldSelectViewport,{children:t.items.map(n=>e.jsxs(d.EmbeddedChat.FormFieldSelectItem,{value:n.value,children:[e.jsx(d.EmbeddedChat.FormFieldSelectItemText,{children:n.label}),e.jsx(d.EmbeddedChat.FormFieldSelectItemIndicator,{})]},n.value))})})]}),e.jsx(d.EmbeddedChat.FormFieldError,{})]},t.name)),e.jsx(d.EmbeddedChat.FormError,{})]})}),e.jsxs(d.EmbeddedChat.FormFooter,{children:[e.jsx(d.EmbeddedChat.FormCancel,{}),e.jsx(d.EmbeddedChat.FormSubmit,{})]})]}),e.jsxs(d.EmbeddedChat.FormSuccess,{children:[e.jsx(d.EmbeddedChat.FormSuccessHeading,{}),e.jsx(d.EmbeddedChat.FormSuccessMessage,{}),e.jsx(d.EmbeddedChat.FormSuccessButton,{})]})]})}exports.InkeepEmbeddedChat=l;exports.InkeepEmbeddedChatImpl=c;exports.InkeepEmbeddedChatImplContent=i;exports.InkeepEmbeddedChatProvider=m;
@@ -1,8 +1,11 @@
1
1
  import { WidgetView, InkeepConfig } from '@inkeep/cxkit-types';
2
+ import { PropsWithChildren } from 'react';
2
3
  import { EmbeddedChatProviderProps } from '@inkeep/cxkit-styled';
3
4
  type ChatConfig = Pick<InkeepConfig, 'baseSettings' | 'aiChatSettings'>;
4
5
  type InkeepEmbeddedChatImplProps = EmbeddedChatProviderProps & WidgetView;
5
6
  export type InkeepEmbeddedChatProps = InkeepEmbeddedChatImplProps & Partial<ChatConfig>;
6
7
  export declare function InkeepEmbeddedChat(props: InkeepEmbeddedChatProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function InkeepEmbeddedChatProvider(props: PropsWithChildren<InkeepEmbeddedChatImplProps>): import("react/jsx-runtime").JSX.Element;
7
9
  export declare function InkeepEmbeddedChatImpl(props: InkeepEmbeddedChatImplProps): import("react/jsx-runtime").JSX.Element;
10
+ export declare function InkeepEmbeddedChatImplContent(props: InkeepEmbeddedChatImplProps): import("react/jsx-runtime").JSX.Element;
8
11
  export {};
@@ -1,8 +1,11 @@
1
1
  import { WidgetView, InkeepConfig } from '@inkeep/cxkit-types';
2
+ import { PropsWithChildren } from 'react';
2
3
  import { EmbeddedChatProviderProps } from '@inkeep/cxkit-styled';
3
4
  type ChatConfig = Pick<InkeepConfig, 'baseSettings' | 'aiChatSettings'>;
4
5
  type InkeepEmbeddedChatImplProps = EmbeddedChatProviderProps & WidgetView;
5
6
  export type InkeepEmbeddedChatProps = InkeepEmbeddedChatImplProps & Partial<ChatConfig>;
6
7
  export declare function InkeepEmbeddedChat(props: InkeepEmbeddedChatProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function InkeepEmbeddedChatProvider(props: PropsWithChildren<InkeepEmbeddedChatImplProps>): import("react/jsx-runtime").JSX.Element;
7
9
  export declare function InkeepEmbeddedChatImpl(props: InkeepEmbeddedChatImplProps): import("react/jsx-runtime").JSX.Element;
10
+ export declare function InkeepEmbeddedChatImplContent(props: InkeepEmbeddedChatImplProps): import("react/jsx-runtime").JSX.Element;
8
11
  export {};
@@ -1,52 +1,60 @@
1
1
  "use client";
2
2
  import { jsx as t, jsxs as n, Fragment as s } from "react/jsx-runtime";
3
- import { Shadow as m, RootProvider as F, WebWidgetInteractionType as u, useModal as g, EmbeddedChat as e, dataAttr as d, Modal as A, PortalWithTheme as l } from "@inkeep/cxkit-styled";
4
- import { Fragment as p } from "react";
3
+ import { Shadow as F, RootProvider as u, WebWidgetInteractionType as g, EmbeddedChat as e, useModal as A, useWidget as p, dataAttr as d, Modal as b, PortalWithTheme as l } from "@inkeep/cxkit-styled";
4
+ import { Fragment as h } from "react";
5
5
  import { WidgetToggle as M } from "./widget-toggle.js";
6
- function E(a) {
6
+ import { ModalContent as I } from "./modal.js";
7
+ function $(a) {
7
8
  const { baseSettings: r, aiChatSettings: c } = a;
8
9
  return /* @__PURE__ */ t(
9
- m,
10
+ F,
10
11
  {
11
12
  wrapperStyles: {
12
13
  height: "inherit",
13
14
  width: "inherit"
14
15
  },
15
16
  children: /* @__PURE__ */ t(
16
- F,
17
+ u,
17
18
  {
18
19
  config: {
19
20
  baseSettings: r,
20
21
  aiChatSettings: c
21
22
  },
22
- componentType: u.EmbeddedChat,
23
- children: /* @__PURE__ */ t(b, { ...a })
23
+ componentType: g.EmbeddedChat,
24
+ children: /* @__PURE__ */ t(k, { ...a })
24
25
  }
25
26
  )
26
27
  }
27
28
  );
28
29
  }
29
- function b(a) {
30
- const { onToggleView: r, isHidden: c, shouldAutoFocusInput: i = !r } = a, o = g();
31
- return /* @__PURE__ */ t(e.Provider, { isHidden: c, shouldAutoFocusInput: i, children: /* @__PURE__ */ n(
30
+ function C(a) {
31
+ const { children: r, onToggleView: c, isHidden: i, shouldAutoFocusInput: o = !c } = a;
32
+ return /* @__PURE__ */ t(e.Provider, { isHidden: i, shouldAutoFocusInput: o, children: r });
33
+ }
34
+ function k(a) {
35
+ return /* @__PURE__ */ t(C, { ...a, children: /* @__PURE__ */ t(T, { ...a }) });
36
+ }
37
+ function T(a) {
38
+ const { onToggleView: r } = a, c = A(), i = p();
39
+ return /* @__PURE__ */ t(c && !i ? I : h, { children: /* @__PURE__ */ n(
32
40
  e.Wrapper,
33
41
  {
34
42
  variant: r ? "no-shadow" : "container-with-shadow",
35
- "data-composite": d(!!a.onToggleView || o?.isOpen),
43
+ "data-composite": d(!!a.onToggleView || c?.isOpen),
36
44
  children: [
37
45
  /* @__PURE__ */ t(e.ConversationLoading, {}),
38
46
  /* @__PURE__ */ n(e.Root, { children: [
39
- /* @__PURE__ */ t(I, { ...a }),
40
- /* @__PURE__ */ t(C, {}),
41
- /* @__PURE__ */ t(w, {})
47
+ /* @__PURE__ */ t(B, { ...a }),
48
+ /* @__PURE__ */ t(S, {}),
49
+ /* @__PURE__ */ t(L, {})
42
50
  ] }),
43
- /* @__PURE__ */ t(L, {}),
44
- /* @__PURE__ */ t(D, {})
51
+ /* @__PURE__ */ t(E, {}),
52
+ /* @__PURE__ */ t(P, {})
45
53
  ]
46
54
  }
47
55
  ) });
48
56
  }
49
- function I(a) {
57
+ function B(a) {
50
58
  const { onToggleView: r, askAILabel: c, searchLabel: i } = a, o = !!r;
51
59
  return /* @__PURE__ */ n(e.Header, { "data-show-toolbar": d(o), children: [
52
60
  o && /* @__PURE__ */ n(e.HeaderToolbar, { children: [
@@ -70,32 +78,32 @@ function I(a) {
70
78
  }
71
79
  )
72
80
  ] }),
73
- /* @__PURE__ */ t(A.Close, {})
81
+ /* @__PURE__ */ t(b.Close, {})
74
82
  ] });
75
83
  }
76
- function C() {
84
+ function S() {
77
85
  return /* @__PURE__ */ t(e.Content, { children: /* @__PURE__ */ n(e.ContentScrollArea, { children: [
78
- /* @__PURE__ */ t(e.ContentScrollAreaViewport, { children: /* @__PURE__ */ t(k, {}) }),
86
+ /* @__PURE__ */ t(e.ContentScrollAreaViewport, { children: /* @__PURE__ */ t(v, {}) }),
79
87
  /* @__PURE__ */ t(e.ContentScrollAreaScrollbar, { children: /* @__PURE__ */ t(e.ContentScrollAreaThumb, {}) }),
80
88
  /* @__PURE__ */ t(e.ContentScrollAreaCorner, {})
81
89
  ] }) });
82
90
  }
83
- function k() {
91
+ function v() {
84
92
  return /* @__PURE__ */ t(e.Messages, { children: ({ messages: a }) => /* @__PURE__ */ n(s, { children: [
85
- /* @__PURE__ */ t(B, {}),
93
+ /* @__PURE__ */ t(w, {}),
86
94
  a.map((r) => /* @__PURE__ */ n(e.MessageWrapper, { message: r, children: [
87
- /* @__PURE__ */ t(T, {}),
95
+ /* @__PURE__ */ t(H, {}),
88
96
  /* @__PURE__ */ t(e.MessageLoading, {}),
89
97
  /* @__PURE__ */ n(e.MessageContentWrapper, { children: [
90
98
  /* @__PURE__ */ t(e.MessageContent, { children: /* @__PURE__ */ t(e.Message, {}) }),
91
- /* @__PURE__ */ t(S, {}),
92
- /* @__PURE__ */ t(v, {}),
93
- /* @__PURE__ */ t(H, {})
99
+ /* @__PURE__ */ t(x, {}),
100
+ /* @__PURE__ */ t(f, {}),
101
+ /* @__PURE__ */ t(y, {})
94
102
  ] })
95
103
  ] }, r.id))
96
104
  ] }) });
97
105
  }
98
- function B() {
106
+ function w() {
99
107
  return /* @__PURE__ */ n(e.IntroMessageWrapper, { children: [
100
108
  /* @__PURE__ */ n(e.MessageHeader, { children: [
101
109
  /* @__PURE__ */ t(e.MessageAvatar, { children: /* @__PURE__ */ n(e.MessageAvatarContent, { children: [
@@ -121,7 +129,7 @@ function B() {
121
129
  ] })
122
130
  ] });
123
131
  }
124
- function T() {
132
+ function H() {
125
133
  return /* @__PURE__ */ n(e.MessageHeader, { children: [
126
134
  /* @__PURE__ */ t(e.MessageAvatar, { children: /* @__PURE__ */ n(e.MessageAvatarContent, { children: [
127
135
  /* @__PURE__ */ t(e.MessageAvatarFallback, {}),
@@ -130,7 +138,7 @@ function T() {
130
138
  /* @__PURE__ */ t(e.MessageName, {})
131
139
  ] });
132
140
  }
133
- function S() {
141
+ function x() {
134
142
  return /* @__PURE__ */ n(e.MessageAttachments, { children: [
135
143
  /* @__PURE__ */ t(e.MessageAttachmentsList, { children: (a) => a.map((r) => /* @__PURE__ */ n(e.MessageAttachmentsItem, { attachment: r, children: [
136
144
  /* @__PURE__ */ t(e.MessageAttachmentsItemIcon, {}),
@@ -143,7 +151,7 @@ function S() {
143
151
  ] }) }) }) })
144
152
  ] });
145
153
  }
146
- function v() {
154
+ function f() {
147
155
  return /* @__PURE__ */ n(e.MessageActions, { children: [
148
156
  /* @__PURE__ */ t(e.MessageToolActions, { children: (a) => a.map((r, c) => /* @__PURE__ */ t(e.MessageToolAction, { action: r }, `action-${c}`)) }),
149
157
  /* @__PURE__ */ t(e.MessageAction, { action: "copy" }),
@@ -151,35 +159,35 @@ function v() {
151
159
  /* @__PURE__ */ t(e.MessageAction, { action: "downvote" })
152
160
  ] });
153
161
  }
154
- function H() {
162
+ function y() {
155
163
  return /* @__PURE__ */ n(e.MessageSources, { children: [
156
164
  /* @__PURE__ */ t(e.MessageSourcesHeader, {}),
157
165
  /* @__PURE__ */ t(e.MessageSourcesList, { children: (a) => a.map((r, c) => /* @__PURE__ */ n(e.MessageSourceItem, { href: r.url, source: r, children: [
158
- /* @__PURE__ */ t(e.MessageSourceItemBreadcrumbs, { children: r.breadcrumbs?.map((i) => /* @__PURE__ */ n(p, { children: [
166
+ /* @__PURE__ */ t(e.MessageSourceItemBreadcrumbs, { children: r.breadcrumbs?.map((i) => /* @__PURE__ */ n(h, { children: [
159
167
  i,
160
168
  /* @__PURE__ */ t(e.MessageSourceItemBreadcrumbIcon, {})
161
169
  ] }, i)) }),
162
170
  /* @__PURE__ */ t(e.MessageSourceItemIcon, {}),
163
171
  /* @__PURE__ */ t(e.MessageSourceItemTitle, {}),
164
172
  /* @__PURE__ */ t(e.MessageSourceItemTag, {}),
165
- /* @__PURE__ */ t(e.MessageSourceItemDescription, { children: (i) => i.map((o, h) => /* @__PURE__ */ t(
173
+ /* @__PURE__ */ t(e.MessageSourceItemDescription, { children: (i) => i.map((o, m) => /* @__PURE__ */ t(
166
174
  e.MessageSourceItemDescriptionPart,
167
175
  {
168
176
  part: o
169
177
  },
170
- `part-${h}`
178
+ `part-${m}`
171
179
  )) }),
172
180
  /* @__PURE__ */ t(e.MessageSourceItemIndicator, {})
173
181
  ] }, c)) })
174
182
  ] });
175
183
  }
176
- function w() {
184
+ function L() {
177
185
  return /* @__PURE__ */ n(e.Footer, { children: [
178
- /* @__PURE__ */ t(x, {}),
179
- /* @__PURE__ */ t(y, {})
186
+ /* @__PURE__ */ t(D, {}),
187
+ /* @__PURE__ */ t(W, {})
180
188
  ] });
181
189
  }
182
- function x() {
190
+ function D() {
183
191
  return /* @__PURE__ */ n(e.InputFieldset, { children: [
184
192
  /* @__PURE__ */ n(e.InputGroup, { children: [
185
193
  /* @__PURE__ */ t(e.Input, {}),
@@ -225,7 +233,7 @@ function x() {
225
233
  ] })
226
234
  ] });
227
235
  }
228
- function y() {
236
+ function W() {
229
237
  return /* @__PURE__ */ n(e.ActionBar, { children: [
230
238
  /* @__PURE__ */ n(e.TaglineContainer, { children: [
231
239
  /* @__PURE__ */ t(e.TaglineText, {}),
@@ -257,7 +265,7 @@ function y() {
257
265
  ] })
258
266
  ] });
259
267
  }
260
- function L() {
268
+ function E() {
261
269
  return /* @__PURE__ */ t(l, { children: /* @__PURE__ */ t(e.FeedbackModal, { children: /* @__PURE__ */ t(e.FeedbackModalOverlay, { children: /* @__PURE__ */ n(e.FeedbackModalContent, { children: [
262
270
  /* @__PURE__ */ t(e.FeedbackModalHeader, {}),
263
271
  /* @__PURE__ */ t(e.FeedbackModalClose, {}),
@@ -285,7 +293,7 @@ function L() {
285
293
  ] }) })
286
294
  ] }) }) }) });
287
295
  }
288
- function D() {
296
+ function P() {
289
297
  return /* @__PURE__ */ n(e.FormWrapper, { children: [
290
298
  /* @__PURE__ */ t(e.FormClose, {}),
291
299
  /* @__PURE__ */ n(e.Form, { children: [
@@ -328,6 +336,8 @@ function D() {
328
336
  ] });
329
337
  }
330
338
  export {
331
- E as InkeepEmbeddedChat,
332
- b as InkeepEmbeddedChatImpl
339
+ $ as InkeepEmbeddedChat,
340
+ k as InkeepEmbeddedChatImpl,
341
+ T as InkeepEmbeddedChatImplContent,
342
+ C as InkeepEmbeddedChatProvider
333
343
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("./embedded-chat.cjs"),t=require("@inkeep/cxkit-styled"),p=require("./embedded-search.cjs"),m=require("./embedded-search-and-chat.impl.cjs");function I(n){const{config:d,...r}=m.useWidgetImpl(n);return e.jsx(t.Shadow,{wrapperStyles:{height:"inherit",width:"inherit"},children:e.jsx(t.RootProvider,{config:d,componentType:t.WebWidgetInteractionType.EmbeddedSearchAndChat,children:e.jsx(a,{...r})})})}function a(n){const{view:d,setView:r,shouldShowAskAICard:u,onToggleView:i,defaultView:c,shouldAutoFocusInput:h,searchLabel:o,askAILabel:s}=n;return e.jsxs(t.WidgetProvider,{widget:{setView:r},children:[e.jsx(p.InkeepEmbeddedSearchImpl,{isHidden:d==="chat",onToggleView:i,shouldShowAskAICard:u,shouldAutoFocusInput:h&&c==="search",searchLabel:o,askAILabel:s}),e.jsx(l.InkeepEmbeddedChatImpl,{isHidden:d==="search",onToggleView:i,shouldAutoFocusInput:h&&c==="chat",askAILabel:s,searchLabel:o})]})}exports.InkeepEmbeddedSearchAndChat=I;exports.InkeepEmbeddedSearchAndChatImpl=a;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("./embedded-chat.cjs"),d=require("@inkeep/cxkit-styled"),p=require("./embedded-search.cjs"),S=require("./embedded-search-and-chat.impl.cjs"),C=require("react"),A=require("./modal.cjs");function g(n){const{config:t,...r}=S.useWidgetImpl(n);return e.jsx(d.Shadow,{wrapperStyles:{height:"inherit",width:"inherit"},children:e.jsx(d.RootProvider,{config:t,componentType:d.WebWidgetInteractionType.EmbeddedSearchAndChat,children:e.jsx(m,{...r})})})}function m(n){const{view:t,setView:r,shouldShowAskAICard:I,onToggleView:o,defaultView:c,shouldAutoFocusInput:s,searchLabel:i,askAILabel:a}=n,b=d.useModal()?A.ModalContent:C.Fragment,h={isHidden:t==="chat",onToggleView:o,shouldShowAskAICard:I,shouldAutoFocusInput:s&&c==="search",searchLabel:i,askAILabel:a},l={isHidden:t==="search",onToggleView:o,shouldAutoFocusInput:s&&c==="chat",searchLabel:i,askAILabel:a};return e.jsx(d.WidgetProvider,{widget:{setView:r},children:e.jsx(p.InkeepEmbeddedSearchProvider,{...h,children:e.jsx(u.InkeepEmbeddedChatProvider,{...l,children:e.jsxs(b,{children:[e.jsx(p.InkeepEmbeddedSearchImplContent,{...h}),e.jsx(u.InkeepEmbeddedChatImplContent,{...l})]})})})})}exports.InkeepEmbeddedSearchAndChat=g;exports.InkeepEmbeddedSearchAndChatImpl=m;
@@ -1,58 +1,54 @@
1
1
  "use client";
2
- import { jsx as e, jsxs as s } from "react/jsx-runtime";
3
- import { InkeepEmbeddedChatImpl as a } 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, ...o } = w(d);
2
+ import { jsx as e, jsxs as l } from "react/jsx-runtime";
3
+ import { InkeepEmbeddedChatProvider as u, InkeepEmbeddedChatImplContent as I } from "./embedded-chat.js";
4
+ import { Shadow as f, RootProvider as b, WebWidgetInteractionType as C, useModal as g, WidgetProvider as w } from "@inkeep/cxkit-styled";
5
+ import { InkeepEmbeddedSearchProvider as A, InkeepEmbeddedSearchImplContent as k } from "./embedded-search.js";
6
+ import { useWidgetImpl as S } from "./embedded-search-and-chat.impl.js";
7
+ import { Fragment as E } from "react";
8
+ import { ModalContent as P } from "./modal.js";
9
+ function L(t) {
10
+ const { config: o, ...d } = S(t);
9
11
  return /* @__PURE__ */ e(
10
- m,
12
+ f,
11
13
  {
12
14
  wrapperStyles: {
13
15
  height: "inherit",
14
16
  width: "inherit"
15
17
  },
16
- children: /* @__PURE__ */ e(u, { config: t, componentType: l.EmbeddedSearchAndChat, children: /* @__PURE__ */ e(A, { ...o }) })
18
+ children: /* @__PURE__ */ e(b, { config: o, componentType: C.EmbeddedSearchAndChat, children: /* @__PURE__ */ e(v, { ...d }) })
17
19
  }
18
20
  );
19
21
  }
20
- function A(d) {
22
+ function v(t) {
21
23
  const {
22
- view: t,
23
- setView: o,
24
- shouldShowAskAICard: p,
24
+ view: o,
25
+ setView: d,
26
+ shouldShowAskAICard: s,
25
27
  onToggleView: r,
26
- defaultView: i,
27
- shouldAutoFocusInput: n,
28
+ defaultView: n,
29
+ shouldAutoFocusInput: i,
28
30
  searchLabel: h,
29
31
  askAILabel: c
30
- } = d;
31
- return /* @__PURE__ */ s(I, { widget: { setView: o }, children: [
32
- /* @__PURE__ */ e(
33
- f,
34
- {
35
- isHidden: t === "chat",
36
- onToggleView: r,
37
- shouldShowAskAICard: p,
38
- shouldAutoFocusInput: n && i === "search",
39
- searchLabel: h,
40
- askAILabel: c
41
- }
42
- ),
43
- /* @__PURE__ */ e(
44
- a,
45
- {
46
- isHidden: t === "search",
47
- onToggleView: r,
48
- shouldAutoFocusInput: n && i === "chat",
49
- askAILabel: c,
50
- searchLabel: h
51
- }
52
- )
53
- ] });
32
+ } = t, m = g() ? P : E, a = {
33
+ isHidden: o === "chat",
34
+ onToggleView: r,
35
+ shouldShowAskAICard: s,
36
+ shouldAutoFocusInput: i && n === "search",
37
+ searchLabel: h,
38
+ askAILabel: c
39
+ }, p = {
40
+ isHidden: o === "search",
41
+ onToggleView: r,
42
+ shouldAutoFocusInput: i && n === "chat",
43
+ searchLabel: h,
44
+ askAILabel: c
45
+ };
46
+ return /* @__PURE__ */ e(w, { widget: { setView: d }, children: /* @__PURE__ */ e(A, { ...a, children: /* @__PURE__ */ e(u, { ...p, children: /* @__PURE__ */ l(m, { children: [
47
+ /* @__PURE__ */ e(k, { ...a }),
48
+ /* @__PURE__ */ e(I, { ...p })
49
+ ] }) }) }) });
54
50
  }
55
51
  export {
56
- E as InkeepEmbeddedSearchAndChat,
57
- A as InkeepEmbeddedSearchAndChatImpl
52
+ L as InkeepEmbeddedSearchAndChat,
53
+ v as InkeepEmbeddedSearchAndChatImpl
58
54
  };
@@ -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"),a=require("./widget-toggle.cjs");function h(r){const{baseSettings:s,searchSettings:c}=r;return e.jsx(d.Shadow,{children:e.jsx(d.RootProvider,{config:{baseSettings:s,searchSettings:c},componentType:d.WebWidgetInteractionType.EmbeddedSearch,children:e.jsx(l,{...r})})})}function l(r){const{onToggleView:s,isHidden:c,shouldAutoFocusInput:t=!s}=r,n=d.useModal();return e.jsx(d.EmbeddedSearch.Provider,{isHidden:c,shouldAutoFocusInput:t,children:e.jsx(d.EmbeddedSearch.Wrapper,{"data-composite":d.dataAttr(!!s||n?.isOpen),children:e.jsxs(d.EmbeddedSearch.Root,{children:[e.jsx(u,{...r}),e.jsxs(d.EmbeddedSearch.Content,{children:[e.jsx(m,{...r}),e.jsx(S,{})]}),e.jsx(x,{})]})})})}function u(r){const{onToggleView:s,askAILabel:c,searchLabel:t}=r,{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,{}),s&&e.jsx(a.WidgetToggle,{onToggleView:s,query:n,askAILabel:c,searchLabel:t,view:"search"}),e.jsx(d.Modal.Close,{})]})}function m(r){const{askAILabel:s,onToggleView:c,shouldShowAskAICard:t=!!c}=r,{query:n}=d.useSearch(),{handleToggle:o}=a.useToggleView({onToggleView:c,query:n});return t?e.jsxs(d.EmbeddedSearch.AskAITrigger,{onSelect:()=>o("chat",!0),children:[e.jsx(d.EmbeddedSearch.AskAITriggerIcon,{}),e.jsxs(d.EmbeddedSearch.AskAITriggerLabel,{children:[s||"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:r=>r.map(s=>e.jsx(d.EmbeddedSearch.ResultsTab,{tab:s},s))}),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:r=>r.map(s=>e.jsxs(d.EmbeddedSearch.ResultsItem,{item:s,children:[e.jsx(d.EmbeddedSearch.ResultsItemBreadcrumbs,{children:c=>c.map(t=>e.jsxs(i.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,{})]},s.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;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("@inkeep/cxkit-styled"),a=require("react"),o=require("./widget-toggle.cjs"),u=require("./modal.cjs");function S(r){const{baseSettings:s,searchSettings:t}=r;return e.jsx(d.Shadow,{children:e.jsx(d.RootProvider,{config:{baseSettings:s,searchSettings:t},componentType:d.WebWidgetInteractionType.EmbeddedSearch,children:e.jsx(i,{...r})})})}function l(r){const{children:s,onToggleView:t,isHidden:n,shouldAutoFocusInput:c=!t}=r;return e.jsx(d.EmbeddedSearch.Provider,{isHidden:n,shouldAutoFocusInput:c,children:s})}function i(r){return e.jsx(l,{...r,children:e.jsx(h,{...r})})}function h(r){const{onToggleView:s}=r,t=d.useModal(),n=d.useWidget(),c=t&&!n?u.ModalContent:a.Fragment;return e.jsx(c,{children:e.jsx(d.EmbeddedSearch.Wrapper,{"data-composite":d.dataAttr(!!s||t?.isOpen),children:e.jsxs(d.EmbeddedSearch.Root,{children:[e.jsx(b,{...r}),e.jsxs(d.EmbeddedSearch.Content,{children:[e.jsx(x,{...r}),e.jsx(j,{})]}),e.jsx(g,{})]})})})}function b(r){const{onToggleView:s,askAILabel:t,searchLabel:n}=r,{query:c}=d.useSearch();return e.jsxs(d.EmbeddedSearch.InputGroup,{children:[e.jsx(d.EmbeddedSearch.InputIcon,{}),e.jsx(d.EmbeddedSearch.Input,{}),e.jsx(d.EmbeddedSearch.Loading,{}),s&&e.jsx(o.WidgetToggle,{onToggleView:s,query:c,askAILabel:t,searchLabel:n,view:"search"}),e.jsx(d.Modal.Close,{})]})}function x(r){const{askAILabel:s,onToggleView:t,shouldShowAskAICard:n=!!t}=r,{query:c}=d.useSearch(),{handleToggle:m}=o.useToggleView({onToggleView:t,query:c});return n?e.jsxs(d.EmbeddedSearch.AskAITrigger,{onSelect:()=>m("chat",!0),children:[e.jsx(d.EmbeddedSearch.AskAITriggerIcon,{}),e.jsxs(d.EmbeddedSearch.AskAITriggerLabel,{children:[s||"Ask AI",c&&` "${c}"`]}),e.jsx(d.EmbeddedSearch.AskAITriggerIndicator,{})]}):null}function j(){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.ResultsScrollArea,{children:[e.jsx(d.EmbeddedSearch.ResultsScrollAreaViewport,{children:e.jsx(E,{})}),e.jsx(d.EmbeddedSearch.ResultsScrollAreaScrollbar,{children:e.jsx(d.EmbeddedSearch.ResultsScrollAreaThumb,{})}),e.jsx(d.EmbeddedSearch.ResultsScrollAreaCorner,{})]})]})}function E(){return 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(n=>e.jsxs(a.Fragment,{children:[n,e.jsx(d.EmbeddedSearch.ResultsItemBreadcrumbIcon,{})]},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((n,c)=>e.jsx(d.EmbeddedSearch.ResultsItemDescriptionPart,{part:n},`part-${c}`))}),e.jsx(d.EmbeddedSearch.ResultsItemIndicator,{})]},s.id))})}function g(){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=S;exports.InkeepEmbeddedSearchImpl=i;exports.InkeepEmbeddedSearchImplContent=h;exports.InkeepEmbeddedSearchProvider=l;
@@ -1,4 +1,5 @@
1
1
  import { WidgetView, InkeepConfig } from '@inkeep/cxkit-types';
2
+ import { PropsWithChildren } from 'react';
2
3
  import { EmbeddedSearchProviderProps } from '@inkeep/cxkit-styled';
3
4
  type SearchConfig = Pick<InkeepConfig, 'baseSettings' | 'searchSettings'>;
4
5
  type InkeepEmbeddedSearchImplProps = EmbeddedSearchProviderProps & WidgetView & {
@@ -10,5 +11,7 @@ type InkeepEmbeddedSearchImplProps = EmbeddedSearchProviderProps & WidgetView &
10
11
  };
11
12
  export type InkeepEmbeddedSearchProps = InkeepEmbeddedSearchImplProps & Partial<SearchConfig>;
12
13
  export declare function InkeepEmbeddedSearch(props: InkeepEmbeddedSearchProps): import("react/jsx-runtime").JSX.Element;
14
+ export declare function InkeepEmbeddedSearchProvider(props: PropsWithChildren<InkeepEmbeddedSearchImplProps>): import("react/jsx-runtime").JSX.Element;
13
15
  export declare function InkeepEmbeddedSearchImpl(props: InkeepEmbeddedSearchImplProps): import("react/jsx-runtime").JSX.Element;
16
+ export declare function InkeepEmbeddedSearchImplContent(props: InkeepEmbeddedSearchImplProps): import("react/jsx-runtime").JSX.Element;
14
17
  export {};
@@ -1,4 +1,5 @@
1
1
  import { WidgetView, InkeepConfig } from '@inkeep/cxkit-types';
2
+ import { PropsWithChildren } from 'react';
2
3
  import { EmbeddedSearchProviderProps } from '@inkeep/cxkit-styled';
3
4
  type SearchConfig = Pick<InkeepConfig, 'baseSettings' | 'searchSettings'>;
4
5
  type InkeepEmbeddedSearchImplProps = EmbeddedSearchProviderProps & WidgetView & {
@@ -10,5 +11,7 @@ type InkeepEmbeddedSearchImplProps = EmbeddedSearchProviderProps & WidgetView &
10
11
  };
11
12
  export type InkeepEmbeddedSearchProps = InkeepEmbeddedSearchImplProps & Partial<SearchConfig>;
12
13
  export declare function InkeepEmbeddedSearch(props: InkeepEmbeddedSearchProps): import("react/jsx-runtime").JSX.Element;
14
+ export declare function InkeepEmbeddedSearchProvider(props: PropsWithChildren<InkeepEmbeddedSearchImplProps>): import("react/jsx-runtime").JSX.Element;
13
15
  export declare function InkeepEmbeddedSearchImpl(props: InkeepEmbeddedSearchImplProps): import("react/jsx-runtime").JSX.Element;
16
+ export declare function InkeepEmbeddedSearchImplContent(props: InkeepEmbeddedSearchImplProps): import("react/jsx-runtime").JSX.Element;
14
17
  export {};
@@ -1,99 +1,109 @@
1
1
  "use client";
2
- import { jsx as e, jsxs as o } from "react/jsx-runtime";
3
- import { Shadow as d, RootProvider as a, WebWidgetInteractionType as g, useModal as h, EmbeddedSearch as r, dataAttr as m, useSearch as c, Modal as I } 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(d, { children: /* @__PURE__ */ e(
9
- a,
2
+ import { jsx as e, jsxs as i } from "react/jsx-runtime";
3
+ import { Shadow as a, RootProvider as g, WebWidgetInteractionType as h, EmbeddedSearch as t, useModal as m, useWidget as I, dataAttr as p, useSearch as c, Modal as R } from "@inkeep/cxkit-styled";
4
+ import { Fragment as d } from "react";
5
+ import { WidgetToggle as T, useToggleView as A } from "./widget-toggle.js";
6
+ import { ModalContent as S } from "./modal.js";
7
+ function P(r) {
8
+ const { baseSettings: n, searchSettings: o } = r;
9
+ return /* @__PURE__ */ e(a, { children: /* @__PURE__ */ e(
10
+ g,
10
11
  {
11
12
  config: {
12
- baseSettings: t,
13
- searchSettings: s
13
+ baseSettings: n,
14
+ searchSettings: o
14
15
  },
15
- componentType: g.EmbeddedSearch,
16
- children: /* @__PURE__ */ e(T, { ...n })
16
+ componentType: h.EmbeddedSearch,
17
+ children: /* @__PURE__ */ e(b, { ...r })
17
18
  }
18
19
  ) });
19
20
  }
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": m(!!t || i?.isOpen), 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, {})
21
+ function f(r) {
22
+ const { children: n, onToggleView: o, isHidden: l, shouldAutoFocusInput: s = !o } = r;
23
+ return /* @__PURE__ */ e(t.Provider, { isHidden: l, shouldAutoFocusInput: s, children: n });
24
+ }
25
+ function b(r) {
26
+ return /* @__PURE__ */ e(f, { ...r, children: /* @__PURE__ */ e(k, { ...r }) });
27
+ }
28
+ function k(r) {
29
+ const { onToggleView: n } = r, o = m(), l = I();
30
+ return /* @__PURE__ */ e(o && !l ? S : d, { children: /* @__PURE__ */ e(t.Wrapper, { "data-composite": p(!!n || o?.isOpen), children: /* @__PURE__ */ i(t.Root, { children: [
31
+ /* @__PURE__ */ e(w, { ...r }),
32
+ /* @__PURE__ */ i(t.Content, { children: [
33
+ /* @__PURE__ */ e(L, { ...r }),
34
+ /* @__PURE__ */ e(C, {})
27
35
  ] }),
28
- /* @__PURE__ */ e(L, {})
36
+ /* @__PURE__ */ e(W, {})
29
37
  ] }) }) });
30
38
  }
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
+ function w(r) {
40
+ const { onToggleView: n, askAILabel: o, searchLabel: l } = r, { query: s } = c();
41
+ return /* @__PURE__ */ i(t.InputGroup, { children: [
42
+ /* @__PURE__ */ e(t.InputIcon, {}),
43
+ /* @__PURE__ */ e(t.Input, {}),
44
+ /* @__PURE__ */ e(t.Loading, {}),
45
+ n && /* @__PURE__ */ e(
46
+ T,
39
47
  {
40
- onToggleView: t,
41
- query: i,
42
- askAILabel: s,
48
+ onToggleView: n,
49
+ query: s,
50
+ askAILabel: o,
43
51
  searchLabel: l,
44
52
  view: "search"
45
53
  }
46
54
  ),
47
- /* @__PURE__ */ e(I.Close, {})
55
+ /* @__PURE__ */ e(R.Close, {})
48
56
  ] });
49
57
  }
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
58
+ function L(r) {
59
+ const { askAILabel: n, onToggleView: o, shouldShowAskAICard: l = !!o } = r, { query: s } = c(), { handleToggle: u } = A({
60
+ onToggleView: o,
61
+ query: s
54
62
  });
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}"`
63
+ return l ? /* @__PURE__ */ i(t.AskAITrigger, { onSelect: () => u("chat", !0), children: [
64
+ /* @__PURE__ */ e(t.AskAITriggerIcon, {}),
65
+ /* @__PURE__ */ i(t.AskAITriggerLabel, { children: [
66
+ n || "Ask AI",
67
+ s && ` "${s}"`
60
68
  ] }),
61
- /* @__PURE__ */ e(r.AskAITriggerIndicator, {})
69
+ /* @__PURE__ */ e(t.AskAITriggerIndicator, {})
62
70
  ] }) : null;
63
71
  }
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, {})
72
+ function C() {
73
+ return /* @__PURE__ */ i(t.Results, { children: [
74
+ /* @__PURE__ */ e(t.ResultsLoading, {}),
75
+ /* @__PURE__ */ e(t.ResultsTabList, { children: (r) => r.map((n) => /* @__PURE__ */ e(t.ResultsTab, { tab: n }, n)) }),
76
+ /* @__PURE__ */ e(t.ResultsEmpty, {}),
77
+ /* @__PURE__ */ i(t.ResultsScrollArea, { children: [
78
+ /* @__PURE__ */ e(t.ResultsScrollAreaViewport, { children: /* @__PURE__ */ e(E, {}) }),
79
+ /* @__PURE__ */ e(t.ResultsScrollAreaScrollbar, { children: /* @__PURE__ */ e(t.ResultsScrollAreaThumb, {}) }),
80
+ /* @__PURE__ */ e(t.ResultsScrollAreaCorner, {})
73
81
  ] })
74
82
  ] });
75
83
  }
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: [
84
+ function E() {
85
+ return /* @__PURE__ */ e(t.ResultsList, { children: (r) => r.map((n) => /* @__PURE__ */ i(t.ResultsItem, { item: n, children: [
86
+ /* @__PURE__ */ e(t.ResultsItemBreadcrumbs, { children: (o) => o.map((l) => /* @__PURE__ */ i(d, { children: [
79
87
  l,
80
- /* @__PURE__ */ e(r.ResultsItemBreadcrumbIcon, {})
88
+ /* @__PURE__ */ e(t.ResultsItemBreadcrumbIcon, {})
81
89
  ] }, 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)) });
90
+ /* @__PURE__ */ e(t.ResultsItemIcon, {}),
91
+ /* @__PURE__ */ e(t.ResultsItemTitle, {}),
92
+ /* @__PURE__ */ e(t.ResultsItemTag, {}),
93
+ /* @__PURE__ */ e(t.ResultsItemDescription, { children: (o) => o.map((l, s) => /* @__PURE__ */ e(t.ResultsItemDescriptionPart, { part: l }, `part-${s}`)) }),
94
+ /* @__PURE__ */ e(t.ResultsItemIndicator, {})
95
+ ] }, n.id)) });
88
96
  }
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, {})
97
+ function W() {
98
+ return /* @__PURE__ */ e(t.Footer, { children: /* @__PURE__ */ i(t.TaglineContainer, { children: [
99
+ /* @__PURE__ */ e(t.TaglineText, {}),
100
+ /* @__PURE__ */ e(t.TaglineLogo, {}),
101
+ /* @__PURE__ */ e(t.TaglineBrandName, {})
94
102
  ] }) });
95
103
  }
96
104
  export {
97
- V as InkeepEmbeddedSearch,
98
- T as InkeepEmbeddedSearchImpl
105
+ P as InkeepEmbeddedSearch,
106
+ b as InkeepEmbeddedSearchImpl,
107
+ k as InkeepEmbeddedSearchImplContent,
108
+ f as InkeepEmbeddedSearchProvider
99
109
  };
@@ -1 +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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./embedded-chat.cjs"),n=require("./embedded-search-and-chat.cjs"),d=require("./embedded-search.cjs"),p=require("./modal.chat.cjs"),h=require("./modal.search-and-chat.cjs"),m=require("./modal.search.cjs"),t=require("./modal.cjs"),a=require("./chat-button.cjs"),r=require("./searchbar.cjs"),I=require("./intelligent-form.cjs");exports.InkeepEmbeddedChat=e.InkeepEmbeddedChat;exports.InkeepEmbeddedChatImpl=e.InkeepEmbeddedChatImpl;exports.InkeepEmbeddedChatImplContent=e.InkeepEmbeddedChatImplContent;exports.InkeepEmbeddedChatProvider=e.InkeepEmbeddedChatProvider;exports.InkeepEmbeddedSearchAndChat=n.InkeepEmbeddedSearchAndChat;exports.InkeepEmbeddedSearchAndChatImpl=n.InkeepEmbeddedSearchAndChatImpl;exports.InkeepEmbeddedSearch=d.InkeepEmbeddedSearch;exports.InkeepEmbeddedSearchImpl=d.InkeepEmbeddedSearchImpl;exports.InkeepEmbeddedSearchImplContent=d.InkeepEmbeddedSearchImplContent;exports.InkeepEmbeddedSearchProvider=d.InkeepEmbeddedSearchProvider;exports.InkeepModalChat=p.InkeepModalChat;exports.InkeepModalSearchAndChat=h.InkeepModalSearchAndChat;exports.InkeepModalSearch=m.InkeepModalSearch;exports.InkeepModal=t.InkeepModal;exports.ModalContent=t.ModalContent;exports.ChatButtonImpl=a.ChatButtonImpl;exports.InkeepChatButton=a.InkeepChatButton;exports.InkeepSearchBar=r.InkeepSearchBar;exports.SearchBarImpl=r.SearchBarImpl;exports.InkeepIntelligentForm=I.InkeepIntelligentForm;exports.InkeepIntelligentFormImpl=I.InkeepIntelligentFormImpl;
@@ -1,28 +1,33 @@
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";
1
+ import { InkeepEmbeddedChat as r, InkeepEmbeddedChatImpl as p, InkeepEmbeddedChatImplContent as o, InkeepEmbeddedChatProvider as t } from "./embedded-chat.js";
2
+ import { InkeepEmbeddedSearchAndChat as m, InkeepEmbeddedSearchAndChatImpl as I } from "./embedded-search-and-chat.js";
3
+ import { InkeepEmbeddedSearch as h, InkeepEmbeddedSearchImpl as k, InkeepEmbeddedSearchImplContent as l, InkeepEmbeddedSearchProvider as C } from "./embedded-search.js";
4
+ import { InkeepModalChat as c } from "./modal.chat.js";
5
+ import { InkeepModalSearchAndChat as x } from "./modal.search-and-chat.js";
6
+ import { InkeepModalSearch as S } from "./modal.search.js";
7
+ import { InkeepModal as i, ModalContent as B } from "./modal.js";
8
+ import { ChatButtonImpl as g, InkeepChatButton as u } from "./chat-button.js";
9
+ import { InkeepSearchBar as F, SearchBarImpl as P } from "./searchbar.js";
10
+ import { InkeepIntelligentForm as q, InkeepIntelligentFormImpl as s } from "./intelligent-form.js";
11
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
12
+ g as ChatButtonImpl,
13
+ u as InkeepChatButton,
14
+ r as InkeepEmbeddedChat,
15
+ p as InkeepEmbeddedChatImpl,
16
+ o as InkeepEmbeddedChatImplContent,
17
+ t as InkeepEmbeddedChatProvider,
18
+ h as InkeepEmbeddedSearch,
19
+ m as InkeepEmbeddedSearchAndChat,
20
+ I as InkeepEmbeddedSearchAndChatImpl,
21
+ k as InkeepEmbeddedSearchImpl,
22
+ l as InkeepEmbeddedSearchImplContent,
23
+ C as InkeepEmbeddedSearchProvider,
24
+ q as InkeepIntelligentForm,
25
+ s as InkeepIntelligentFormImpl,
26
+ i as InkeepModal,
27
+ c as InkeepModalChat,
28
+ S as InkeepModalSearch,
29
+ x as InkeepModalSearchAndChat,
30
+ F as InkeepSearchBar,
31
+ B as ModalContent,
32
+ P as SearchBarImpl
28
33
  };
@@ -1 +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},componentType: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(x,{}),e.jsx(u,{})]}),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 x(){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 u(){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;
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},componentType:n.WebWidgetInteractionType.IntelligentForm,children:e.jsx(s,{...r})})})}function s(r){const{formSettings:t}=r;return e.jsx(n.IntelligentForm.Provider,{formSettings: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(x,{}),e.jsx(u,{})]}),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 x(){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 u(){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;
@@ -1,6 +1,6 @@
1
- import { InkeepConfig, IntelligentFormConfig } from '@inkeep/cxkit-types';
1
+ import { InkeepConfig, IntelligentFormSettings } from '@inkeep/cxkit-types';
2
2
  interface InkeepIntelligentFormImplProps {
3
- formConfig: IntelligentFormConfig;
3
+ formSettings: IntelligentFormSettings;
4
4
  }
5
5
  export type InkeepIntelligentFormProps = InkeepIntelligentFormImplProps & Partial<Pick<InkeepConfig, 'baseSettings'>>;
6
6
  export declare function InkeepIntelligentForm(props: InkeepIntelligentFormProps): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
- import { InkeepConfig, IntelligentFormConfig } from '@inkeep/cxkit-types';
1
+ import { InkeepConfig, IntelligentFormSettings } from '@inkeep/cxkit-types';
2
2
  interface InkeepIntelligentFormImplProps {
3
- formConfig: IntelligentFormConfig;
3
+ formSettings: IntelligentFormSettings;
4
4
  }
5
5
  export type InkeepIntelligentFormProps = InkeepIntelligentFormImplProps & Partial<Pick<InkeepConfig, 'baseSettings'>>;
6
6
  export declare function InkeepIntelligentForm(props: InkeepIntelligentFormProps): import("react/jsx-runtime").JSX.Element;
@@ -1,10 +1,10 @@
1
1
  "use client";
2
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";
3
+ import { Shadow as d, RootProvider as a, WebWidgetInteractionType as S, IntelligentForm as e, useIntelligentForm as l, LoadingIndicator as m } from "@inkeep/cxkit-styled";
4
4
  function b(o) {
5
5
  const { baseSettings: r } = o;
6
6
  return /* @__PURE__ */ n(
7
- s,
7
+ d,
8
8
  {
9
9
  wrapperStyles: {
10
10
  height: "inherit",
@@ -24,8 +24,8 @@ function b(o) {
24
24
  );
25
25
  }
26
26
  function h(o) {
27
- const { formConfig: r } = o;
28
- return /* @__PURE__ */ n(e.Provider, { formConfig: r, children: /* @__PURE__ */ t(e.Root, { children: [
27
+ const { formSettings: r } = o;
28
+ return /* @__PURE__ */ n(e.Provider, { formSettings: r, children: /* @__PURE__ */ t(e.Root, { children: [
29
29
  /* @__PURE__ */ n(e.Heading, {}),
30
30
  /* @__PURE__ */ n(e.Content, { children: /* @__PURE__ */ t(e.ContentScrollArea, { children: [
31
31
  /* @__PURE__ */ t(e.ContentScrollAreaViewport, { children: [
@@ -51,7 +51,7 @@ function f() {
51
51
  const { isSubmitSuccessful: o } = l();
52
52
  return o ? null : /* @__PURE__ */ t(e.PrimaryForm, { children: [
53
53
  /* @__PURE__ */ n(e.PrimaryFormDescription, {}),
54
- /* @__PURE__ */ n(e.PrimaryFormFields, { children: (r) => r.map((i) => /* @__PURE__ */ n(d, { field: i }, i.name)) }),
54
+ /* @__PURE__ */ n(e.PrimaryFormFields, { children: (r) => r.map((i) => /* @__PURE__ */ n(s, { field: i }, i.name)) }),
55
55
  /* @__PURE__ */ n(e.PrimaryFormSubmit, {})
56
56
  ] });
57
57
  }
@@ -97,12 +97,12 @@ function I() {
97
97
  ] }, c.url)) })
98
98
  ] }),
99
99
  /* @__PURE__ */ n(e.SecondaryFormDescription, {}),
100
- /* @__PURE__ */ n(e.SecondaryFormFields, { children: (i) => i.map((c) => /* @__PURE__ */ n(d, { field: c }, c.name)) }),
100
+ /* @__PURE__ */ n(e.SecondaryFormFields, { children: (i) => i.map((c) => /* @__PURE__ */ n(s, { field: c }, c.name)) }),
101
101
  /* @__PURE__ */ n(e.Error, {}),
102
102
  /* @__PURE__ */ n(e.SecondaryFormSubmit, {})
103
103
  ] });
104
104
  }
105
- function d(o) {
105
+ function s(o) {
106
106
  const { field: r } = o;
107
107
  return /* @__PURE__ */ t(e.Field, { field: r, children: [
108
108
  /* @__PURE__ */ n(e.FieldLabel, {}),
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("@inkeep/cxkit-styled");function c(n){const{componentType:t,children:r,modalSettings:i,...l}=n;return e.jsx(o.Portal,{children:e.jsx(o.Shadow,{children:e.jsx(o.RootProvider,{config:{...l},componentType:t,children:e.jsx(o.Modal.Root,{config:i,children:e.jsx(o.Modal.Overlay,{children:e.jsx(o.Modal.Content,{children:r})})})})})})}exports.InkeepModal=c;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("@inkeep/cxkit-styled");function d(o){const{componentType:t,children:r,modalSettings:l,...i}=o;return e.jsx(n.Portal,{children:e.jsx(n.Shadow,{children:e.jsx(n.RootProvider,{config:{...i},componentType:t,children:e.jsx(n.Modal.Root,{config:l,children:r})})})})}function c(o){return e.jsx(n.Modal.Overlay,{children:e.jsx(n.Modal.Content,{children:o.children})})}exports.InkeepModal=d;exports.ModalContent=c;
@@ -1,5 +1,6 @@
1
1
  import { InkeepModalSettings } from '@inkeep/cxkit-types';
2
2
  import { WebWidgetInteractionType, RootProviderProps } from '@inkeep/cxkit-styled';
3
+ import { PropsWithChildren } from 'react';
3
4
  type RootConfig = RootProviderProps['config'];
4
5
  interface ModalConfig extends RootConfig {
5
6
  /**
@@ -18,4 +19,5 @@ export interface InkeepModalProps extends ModalConfig {
18
19
  componentType: (typeof WebWidgetInteractionType)[keyof typeof WebWidgetInteractionType];
19
20
  }
20
21
  export declare function InkeepModal(props: InkeepModalProps): import("react/jsx-runtime").JSX.Element;
22
+ export declare function ModalContent(props: PropsWithChildren): import("react/jsx-runtime").JSX.Element;
21
23
  export {};
@@ -1,5 +1,6 @@
1
1
  import { InkeepModalSettings } from '@inkeep/cxkit-types';
2
2
  import { WebWidgetInteractionType, RootProviderProps } from '@inkeep/cxkit-styled';
3
+ import { PropsWithChildren } from 'react';
3
4
  type RootConfig = RootProviderProps['config'];
4
5
  interface ModalConfig extends RootConfig {
5
6
  /**
@@ -18,4 +19,5 @@ export interface InkeepModalProps extends ModalConfig {
18
19
  componentType: (typeof WebWidgetInteractionType)[keyof typeof WebWidgetInteractionType];
19
20
  }
20
21
  export declare function InkeepModal(props: InkeepModalProps): import("react/jsx-runtime").JSX.Element;
22
+ export declare function ModalContent(props: PropsWithChildren): import("react/jsx-runtime").JSX.Element;
21
23
  export {};
@@ -1,19 +1,23 @@
1
1
  "use client";
2
- import { jsx as o } from "react/jsx-runtime";
2
+ import { jsx as n } from "react/jsx-runtime";
3
3
  import { Portal as l, Shadow as d, RootProvider as h, Modal as e } from "@inkeep/cxkit-styled";
4
- function p(n) {
5
- const { componentType: r, children: t, modalSettings: i, ...c } = n;
6
- return /* @__PURE__ */ o(l, { children: /* @__PURE__ */ o(d, { children: /* @__PURE__ */ o(
4
+ function m(o) {
5
+ const { componentType: r, children: t, modalSettings: i, ...c } = o;
6
+ return /* @__PURE__ */ n(l, { children: /* @__PURE__ */ n(d, { children: /* @__PURE__ */ n(
7
7
  h,
8
8
  {
9
9
  config: {
10
10
  ...c
11
11
  },
12
12
  componentType: r,
13
- children: /* @__PURE__ */ o(e.Root, { config: i, children: /* @__PURE__ */ o(e.Overlay, { children: /* @__PURE__ */ o(e.Content, { children: t }) }) })
13
+ children: /* @__PURE__ */ n(e.Root, { config: i, children: t })
14
14
  }
15
15
  ) }) });
16
16
  }
17
+ function p(o) {
18
+ return /* @__PURE__ */ n(e.Overlay, { children: /* @__PURE__ */ n(e.Content, { children: o.children }) });
19
+ }
17
20
  export {
18
- p as InkeepModal
21
+ m as InkeepModal,
22
+ p as ModalContent
19
23
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("react"),B=require("./embedded-search-and-chat.cjs"),m=require("./embedded-search-and-chat.impl.cjs"),x=require("./embedded-search.cjs"),r=require("@inkeep/cxkit-styled"),j=require("./modal.cjs");function g(a){const[o,t]=u.useState(!1),{modalSettings:n,defaultView:c="search",canToggleView:p=!0,...s}=a,{config:h,...i}=m.useWidgetImpl({...s,defaultView:c}),d={shortcutKey:"k",...n,isOpen:o,onOpenChange:S=>{a.forceDefaultView&&!S&&i.setView(c??"search"),t(!!S)}};return e.jsxs(e.Fragment,{children:[e.jsx(r.Shadow,{wrapperStyles:{display:"contents"},children:e.jsx(r.RootProvider,{config:h,componentType:r.WebWidgetInteractionType.SearchBar,children:e.jsx(l,{setOpen:t,modalSettings:d})})}),e.jsx(j.InkeepModal,{...h,modalSettings:d,componentType:r.WebWidgetInteractionType.SearchBar,children:p?e.jsx(B.InkeepEmbeddedSearchAndChatImpl,{...i}):e.jsx(x.InkeepEmbeddedSearchImpl,{...s})})]})}function l(a){const{setOpen:o,modalSettings:t}=a;return e.jsx(r.SearchBar.SearchBarContainer,{children:e.jsxs(r.SearchBar.SearchBarButton,{onPointerDown:n=>{n.button!==2&&(o(c=>!c),n.stopPropagation())},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=g;exports.SearchBarImpl=l;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("react"),B=require("./embedded-search-and-chat.cjs"),m=require("./embedded-search-and-chat.impl.cjs"),x=require("./embedded-search.cjs"),r=require("@inkeep/cxkit-styled"),j=require("./modal.cjs");function g(a){const[n,t]=u.useState(!1),{modalSettings:s,defaultView:c="search",canToggleView:p=!0,...o}=a,{config:h,...i}=m.useWidgetImpl({...o,defaultView:c}),d={shortcutKey:"k",...s,isOpen:n,onOpenChange:S=>{a.forceDefaultView&&!S&&i.setView(c??"search"),t(!!S)}};return e.jsxs(e.Fragment,{children:[e.jsx(r.Shadow,{wrapperStyles:{display:"contents"},children:e.jsx(r.RootProvider,{config:h,componentType:r.WebWidgetInteractionType.SearchBar,children:e.jsx(l,{setOpen:t,modalSettings:d})})}),e.jsx(j.InkeepModal,{...h,modalSettings:d,componentType:r.WebWidgetInteractionType.SearchBar,children:p?e.jsx(B.InkeepEmbeddedSearchAndChatImpl,{...i}):e.jsx(x.InkeepEmbeddedSearchImpl,{...o})})]})}function l(a){const{setOpen:n,modalSettings:t}=a;return e.jsx(r.SearchBar.SearchBarContainer,{children:e.jsxs(r.SearchBar.SearchBarButton,{onClick:s=>{s.button!==2&&n(c=>!c)},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=g;exports.SearchBarImpl=l;
@@ -1,27 +1,27 @@
1
1
  "use client";
2
- import { jsxs as c, Fragment as u, jsx as e } from "react/jsx-runtime";
2
+ import { jsxs as a, Fragment as u, jsx as e } from "react/jsx-runtime";
3
3
  import { useState as f } from "react";
4
4
  import { InkeepEmbeddedSearchAndChatImpl as B } from "./embedded-search-and-chat.js";
5
5
  import { useWidgetImpl as g } from "./embedded-search-and-chat.impl.js";
6
6
  import { InkeepEmbeddedSearchImpl as y } from "./embedded-search.js";
7
7
  import { Shadow as I, RootProvider as K, WebWidgetInteractionType as l, SearchBar as r } from "@inkeep/cxkit-styled";
8
8
  import { InkeepModal as b } from "./modal.js";
9
- function j(n) {
10
- const [i, t] = f(!1), {
11
- modalSettings: o,
12
- defaultView: a = "search",
9
+ function E(n) {
10
+ const [c, t] = f(!1), {
11
+ modalSettings: i,
12
+ defaultView: o = "search",
13
13
  canToggleView: S = !0,
14
14
  ...h
15
- } = n, { config: p, ...s } = g({ ...h, defaultView: a }), d = {
15
+ } = n, { config: p, ...s } = g({ ...h, defaultView: o }), d = {
16
16
  shortcutKey: "k",
17
- ...o,
18
- isOpen: i,
17
+ ...i,
18
+ isOpen: c,
19
19
  onOpenChange: (m) => {
20
- n.forceDefaultView && !m && s.setView(a ?? "search"), t(!!m);
20
+ n.forceDefaultView && !m && s.setView(o ?? "search"), t(!!m);
21
21
  }
22
22
  };
23
- return /* @__PURE__ */ c(u, { children: [
24
- /* @__PURE__ */ e(I, { wrapperStyles: { display: "contents" }, children: /* @__PURE__ */ e(K, { config: p, componentType: l.SearchBar, children: /* @__PURE__ */ e(w, { setOpen: t, modalSettings: d }) }) }),
23
+ return /* @__PURE__ */ a(u, { children: [
24
+ /* @__PURE__ */ e(I, { wrapperStyles: { display: "contents" }, children: /* @__PURE__ */ e(K, { config: p, componentType: l.SearchBar, children: /* @__PURE__ */ e(k, { setOpen: t, modalSettings: d }) }) }),
25
25
  /* @__PURE__ */ e(
26
26
  b,
27
27
  {
@@ -33,20 +33,20 @@ function j(n) {
33
33
  )
34
34
  ] });
35
35
  }
36
- function w(n) {
37
- const { setOpen: i, modalSettings: t } = n;
38
- return /* @__PURE__ */ e(r.SearchBarContainer, { children: /* @__PURE__ */ c(
36
+ function k(n) {
37
+ const { setOpen: c, modalSettings: t } = n;
38
+ return /* @__PURE__ */ e(r.SearchBarContainer, { children: /* @__PURE__ */ a(
39
39
  r.SearchBarButton,
40
40
  {
41
- onPointerDown: (o) => {
42
- o.button !== 2 && (i((a) => !a), o.stopPropagation());
41
+ onClick: (i) => {
42
+ i.button !== 2 && c((o) => !o);
43
43
  },
44
44
  children: [
45
- /* @__PURE__ */ c(r.SearchBarContentWrapper, { children: [
45
+ /* @__PURE__ */ a(r.SearchBarContentWrapper, { children: [
46
46
  /* @__PURE__ */ e(r.SearchBarIcon, {}),
47
47
  /* @__PURE__ */ e(r.SearchBarText, {})
48
48
  ] }),
49
- /* @__PURE__ */ c(r.SearchBarKbdWrapper, { children: [
49
+ /* @__PURE__ */ a(r.SearchBarKbdWrapper, { children: [
50
50
  /* @__PURE__ */ e(r.SearchBarKbdModifier, { shortcutKey: t?.shortcutKey }),
51
51
  /* @__PURE__ */ e(r.SearchBarKbdShortcutKey, { shortcutKey: t?.shortcutKey })
52
52
  ] })
@@ -55,6 +55,6 @@ function w(n) {
55
55
  ) });
56
56
  }
57
57
  export {
58
- j as InkeepSearchBar,
59
- w as SearchBarImpl
58
+ E as InkeepSearchBar,
59
+ k as SearchBarImpl
60
60
  };
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./components/embedded-chat.cjs"),n=require("./components/embedded-search-and-chat.cjs"),a=require("./components/embedded-search.cjs"),I=require("./components/modal.chat.cjs"),c=require("./components/modal.search-and-chat.cjs"),l=require("./components/modal.search.cjs"),o=require("./components/modal.cjs"),r=require("./components/chat-button.cjs"),p=require("./components/searchbar.cjs"),h=require("./components/intelligent-form.cjs"),d=require("@inkeep/cxkit-styled");exports.InkeepEmbeddedChat=t.InkeepEmbeddedChat;exports.InkeepEmbeddedChatImpl=t.InkeepEmbeddedChatImpl;exports.InkeepEmbeddedSearchAndChat=n.InkeepEmbeddedSearchAndChat;exports.InkeepEmbeddedSearchAndChatImpl=n.InkeepEmbeddedSearchAndChatImpl;exports.InkeepEmbeddedSearch=a.InkeepEmbeddedSearch;exports.InkeepEmbeddedSearchImpl=a.InkeepEmbeddedSearchImpl;exports.InkeepModalChat=I.InkeepModalChat;exports.InkeepModalSearchAndChat=c.InkeepModalSearchAndChat;exports.InkeepModalSearch=l.InkeepModalSearch;exports.InkeepModal=o.InkeepModal;exports.ChatButtonImpl=r.ChatButtonImpl;exports.InkeepChatButton=r.InkeepChatButton;exports.InkeepSearchBar=p.InkeepSearchBar;exports.SearchBarImpl=p.SearchBarImpl;exports.InkeepIntelligentForm=h.InkeepIntelligentForm;exports.InkeepIntelligentFormImpl=h.InkeepIntelligentFormImpl;Object.keys(d).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>d[e]})});
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./components/embedded-chat.cjs"),r=require("./components/embedded-search-and-chat.cjs"),n=require("./components/embedded-search.cjs"),h=require("./components/modal.chat.cjs"),m=require("./components/modal.search-and-chat.cjs"),l=require("./components/modal.search.cjs"),a=require("./components/modal.cjs"),p=require("./components/chat-button.cjs"),I=require("./components/searchbar.cjs"),o=require("./components/intelligent-form.cjs"),t=require("@inkeep/cxkit-styled");exports.InkeepEmbeddedChat=d.InkeepEmbeddedChat;exports.InkeepEmbeddedChatImpl=d.InkeepEmbeddedChatImpl;exports.InkeepEmbeddedChatImplContent=d.InkeepEmbeddedChatImplContent;exports.InkeepEmbeddedChatProvider=d.InkeepEmbeddedChatProvider;exports.InkeepEmbeddedSearchAndChat=r.InkeepEmbeddedSearchAndChat;exports.InkeepEmbeddedSearchAndChatImpl=r.InkeepEmbeddedSearchAndChatImpl;exports.InkeepEmbeddedSearch=n.InkeepEmbeddedSearch;exports.InkeepEmbeddedSearchImpl=n.InkeepEmbeddedSearchImpl;exports.InkeepEmbeddedSearchImplContent=n.InkeepEmbeddedSearchImplContent;exports.InkeepEmbeddedSearchProvider=n.InkeepEmbeddedSearchProvider;exports.InkeepModalChat=h.InkeepModalChat;exports.InkeepModalSearchAndChat=m.InkeepModalSearchAndChat;exports.InkeepModalSearch=l.InkeepModalSearch;exports.InkeepModal=a.InkeepModal;exports.ModalContent=a.ModalContent;exports.ChatButtonImpl=p.ChatButtonImpl;exports.InkeepChatButton=p.InkeepChatButton;exports.InkeepSearchBar=I.InkeepSearchBar;exports.SearchBarImpl=I.SearchBarImpl;exports.InkeepIntelligentForm=o.InkeepIntelligentForm;exports.InkeepIntelligentFormImpl=o.InkeepIntelligentFormImpl;Object.keys(t).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})});
package/dist/index.js CHANGED
@@ -1,29 +1,34 @@
1
- import { InkeepEmbeddedChat as p, InkeepEmbeddedChatImpl as o } from "./components/embedded-chat.js";
2
- import { InkeepEmbeddedSearchAndChat as d, InkeepEmbeddedSearchAndChatImpl as m } from "./components/embedded-search-and-chat.js";
3
- import { InkeepEmbeddedSearch as a, InkeepEmbeddedSearchImpl as I } from "./components/embedded-search.js";
4
- import { InkeepModalChat as k } from "./components/modal.chat.js";
5
- import { InkeepModalSearchAndChat as f } from "./components/modal.search-and-chat.js";
6
- import { InkeepModalSearch as c } from "./components/modal.search.js";
7
- import { InkeepModal as S } from "./components/modal.js";
8
- import { ChatButtonImpl as E, InkeepChatButton as B } from "./components/chat-button.js";
9
- import { InkeepSearchBar as A, SearchBarImpl as g } from "./components/searchbar.js";
10
- import { InkeepIntelligentForm as u, InkeepIntelligentFormImpl as F } from "./components/intelligent-form.js";
1
+ import { InkeepEmbeddedChat as r, InkeepEmbeddedChatImpl as p, InkeepEmbeddedChatImplContent as o, InkeepEmbeddedChatProvider as t } from "./components/embedded-chat.js";
2
+ import { InkeepEmbeddedSearchAndChat as m, InkeepEmbeddedSearchAndChatImpl as I } from "./components/embedded-search-and-chat.js";
3
+ import { InkeepEmbeddedSearch as h, InkeepEmbeddedSearchImpl as k, InkeepEmbeddedSearchImplContent as l, InkeepEmbeddedSearchProvider as C } from "./components/embedded-search.js";
4
+ import { InkeepModalChat as x } from "./components/modal.chat.js";
5
+ import { InkeepModalSearchAndChat as c } from "./components/modal.search-and-chat.js";
6
+ import { InkeepModalSearch as S } from "./components/modal.search.js";
7
+ import { InkeepModal as i, ModalContent as B } from "./components/modal.js";
8
+ import { ChatButtonImpl as g, InkeepChatButton as u } from "./components/chat-button.js";
9
+ import { InkeepSearchBar as F, SearchBarImpl as P } from "./components/searchbar.js";
10
+ import { InkeepIntelligentForm as q, InkeepIntelligentFormImpl as s } from "./components/intelligent-form.js";
11
11
  export * from "@inkeep/cxkit-styled";
12
12
  export {
13
- E as ChatButtonImpl,
14
- B as InkeepChatButton,
15
- p as InkeepEmbeddedChat,
16
- o as InkeepEmbeddedChatImpl,
17
- a as InkeepEmbeddedSearch,
18
- d as InkeepEmbeddedSearchAndChat,
19
- m as InkeepEmbeddedSearchAndChatImpl,
20
- I as InkeepEmbeddedSearchImpl,
21
- u as InkeepIntelligentForm,
22
- F as InkeepIntelligentFormImpl,
23
- S as InkeepModal,
24
- k as InkeepModalChat,
25
- c as InkeepModalSearch,
26
- f as InkeepModalSearchAndChat,
27
- A as InkeepSearchBar,
28
- g as SearchBarImpl
13
+ g as ChatButtonImpl,
14
+ u as InkeepChatButton,
15
+ r as InkeepEmbeddedChat,
16
+ p as InkeepEmbeddedChatImpl,
17
+ o as InkeepEmbeddedChatImplContent,
18
+ t as InkeepEmbeddedChatProvider,
19
+ h as InkeepEmbeddedSearch,
20
+ m as InkeepEmbeddedSearchAndChat,
21
+ I as InkeepEmbeddedSearchAndChatImpl,
22
+ k as InkeepEmbeddedSearchImpl,
23
+ l as InkeepEmbeddedSearchImplContent,
24
+ C as InkeepEmbeddedSearchProvider,
25
+ q as InkeepIntelligentForm,
26
+ s as InkeepIntelligentFormImpl,
27
+ i as InkeepModal,
28
+ x as InkeepModalChat,
29
+ S as InkeepModalSearch,
30
+ c as InkeepModalSearchAndChat,
31
+ F as InkeepSearchBar,
32
+ B as ModalContent,
33
+ P as SearchBarImpl
29
34
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/cxkit-react",
3
- "version": "0.5.6",
3
+ "version": "0.5.9",
4
4
  "description": "",
5
5
  "license": "Inkeep, Inc. Customer License (IICL) v1.1",
6
6
  "homepage": "",
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "sideEffects": false,
22
22
  "dependencies": {
23
- "@inkeep/cxkit-styled": "0.5.6"
23
+ "@inkeep/cxkit-styled": "0.5.9"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@biomejs/biome": "1.9.4",
@@ -43,8 +43,8 @@
43
43
  "typescript": "5.7.3",
44
44
  "vite": "5.4.11",
45
45
  "vite-plugin-dts": "4.4.0",
46
- "@inkeep/cxkit-color-mode": "0.5.6",
47
- "@inkeep/cxkit-types": "0.5.6"
46
+ "@inkeep/cxkit-color-mode": "0.5.9",
47
+ "@inkeep/cxkit-types": "0.5.9"
48
48
  },
49
49
  "module": "dist/index.js",
50
50
  "types": "dist/index.d.ts",