@inkeep/cxkit-react 0.5.70 → 0.5.72

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("@inkeep/cxkit-styled"),h=require("react"),b=require("./widget-toggle.cjs"),l=require("./modal.cjs");function C(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(o,{...a})})}function o(a){const{onToggleView:t}=a,s=d.useModal(),n=d.useWidget(),r=s&&!n?l.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(p,{}),e.jsx(A,{})]})]},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.ExampleQuestions,{children:[e.jsx(d.EmbeddedChat.ExampleQuestionsLabel,{}),e.jsx(d.EmbeddedChat.ExampleQuestionsList,{children:a=>a.map(t=>e.jsx(d.EmbeddedChat.ExampleQuestion,{children:e.jsx(d.EmbeddedChat.ExampleQuestionButton,{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 p(){return e.jsxs(d.EmbeddedChat.MessageToolbar,{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 A(){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,i)=>e.jsx(d.EmbeddedChat.MessageSourceItemDescriptionPart,{part:r},`part-${i}`))}),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=C;exports.InkeepEmbeddedChatImpl=c;exports.InkeepEmbeddedChatImplContent=o;exports.InkeepEmbeddedChatProvider=m;
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"),l=require("./modal.cjs");function C(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(o,{...a})})}function o(a){const{onToggleView:t}=a,s=d.useModal(),n=d.useWidget(),r=s&&!n?l.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.jsx(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,{})]}):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(p,{}),e.jsx(A,{})]})]},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.ExampleQuestions,{children:[e.jsx(d.EmbeddedChat.ExampleQuestionsLabel,{}),e.jsx(d.EmbeddedChat.ExampleQuestionsList,{children:a=>a.map(t=>e.jsx(d.EmbeddedChat.ExampleQuestion,{children:e.jsx(d.EmbeddedChat.ExampleQuestionButton,{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 p(){return e.jsxs(d.EmbeddedChat.MessageToolbar,{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 A(){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,i)=>e.jsx(d.EmbeddedChat.MessageSourceItemDescriptionPart,{part:r},`part-${i}`))}),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=C;exports.InkeepEmbeddedChatImpl=c;exports.InkeepEmbeddedChatImplContent=o;exports.InkeepEmbeddedChatProvider=m;
@@ -1,26 +1,26 @@
1
1
  "use client";
2
2
  import { jsx as t, jsxs as n, Fragment as l } from "react/jsx-runtime";
3
- import { Shadow as F, RootProvider as u, WebWidgetInteractionType as g, EmbeddedChat as e, useModal as p, useWidget as A, dataAttr as d, Modal as b, PortalWithTheme as s } from "@inkeep/cxkit-styled";
4
- import { Fragment as m } from "react";
3
+ import { Shadow as u, RootProvider as g, WebWidgetInteractionType as p, EmbeddedChat as e, useModal as A, useWidget as b, dataAttr as m, Modal as d, PortalWithTheme as s } from "@inkeep/cxkit-styled";
4
+ import { Fragment as h } from "react";
5
5
  import { WidgetToggle as M } from "./widget-toggle.js";
6
6
  import { ModalContent as I } from "./modal.js";
7
7
  function $(a) {
8
8
  const { baseSettings: r, aiChatSettings: c } = a;
9
9
  return /* @__PURE__ */ t(
10
- F,
10
+ u,
11
11
  {
12
12
  wrapperStyles: {
13
13
  height: "inherit",
14
14
  width: "inherit"
15
15
  },
16
16
  children: /* @__PURE__ */ t(
17
- u,
17
+ g,
18
18
  {
19
19
  config: {
20
20
  baseSettings: r,
21
21
  aiChatSettings: c
22
22
  },
23
- componentType: g.EmbeddedChat,
23
+ componentType: p.EmbeddedChat,
24
24
  children: /* @__PURE__ */ t(k, { ...a })
25
25
  }
26
26
  )
@@ -35,12 +35,12 @@ function k(a) {
35
35
  return /* @__PURE__ */ t(C, { ...a, children: /* @__PURE__ */ t(T, { ...a }) });
36
36
  }
37
37
  function T(a) {
38
- const { onToggleView: r } = a, c = p(), o = A();
39
- return /* @__PURE__ */ t(c && !o ? I : m, { children: /* @__PURE__ */ n(
38
+ const { onToggleView: r } = a, c = A(), o = b();
39
+ return /* @__PURE__ */ t(c && !o ? I : h, { children: /* @__PURE__ */ n(
40
40
  e.Wrapper,
41
41
  {
42
42
  variant: r ? "no-shadow" : "container-with-shadow",
43
- "data-composite": d(!!a.onToggleView || c?.isOpen),
43
+ "data-composite": m(!!a.onToggleView || c?.isOpen),
44
44
  children: [
45
45
  /* @__PURE__ */ t(e.ConversationLoading, {}),
46
46
  /* @__PURE__ */ n(e.Root, { children: [
@@ -56,30 +56,28 @@ function T(a) {
56
56
  }
57
57
  function B(a) {
58
58
  const { onToggleView: r, askAILabel: c, searchLabel: o } = a, i = !!r;
59
- return /* @__PURE__ */ n(e.Header, { "data-show-toolbar": d(i), children: [
60
- i && /* @__PURE__ */ n(e.HeaderToolbar, { children: [
61
- /* @__PURE__ */ n(e.HeaderToolbarWrapper, { children: [
62
- /* @__PURE__ */ t(e.ToolbarHeader, {}),
63
- /* @__PURE__ */ n(e.Disclaimer, { children: [
64
- /* @__PURE__ */ t(e.DisclaimerTrigger, {}),
65
- /* @__PURE__ */ n(e.DisclaimerContent, { side: "bottom", align: "start", children: [
66
- /* @__PURE__ */ t(e.DisclaimerText, {}),
67
- /* @__PURE__ */ t(e.DisclaimerArrow, {})
68
- ] })
59
+ return /* @__PURE__ */ t(e.Header, { "data-show-toolbar": m(i), children: i ? /* @__PURE__ */ n(e.HeaderToolbar, { children: [
60
+ /* @__PURE__ */ n(e.HeaderToolbarWrapper, { children: [
61
+ /* @__PURE__ */ t(e.ToolbarHeader, {}),
62
+ /* @__PURE__ */ n(e.Disclaimer, { children: [
63
+ /* @__PURE__ */ t(e.DisclaimerTrigger, {}),
64
+ /* @__PURE__ */ n(e.DisclaimerContent, { side: "bottom", align: "start", children: [
65
+ /* @__PURE__ */ t(e.DisclaimerText, {}),
66
+ /* @__PURE__ */ t(e.DisclaimerArrow, {})
69
67
  ] })
70
- ] }),
71
- /* @__PURE__ */ t(
72
- M,
73
- {
74
- onToggleView: r,
75
- askAILabel: c,
76
- searchLabel: o,
77
- view: "chat"
78
- }
79
- )
68
+ ] })
80
69
  ] }),
81
- /* @__PURE__ */ t(b.Close, {})
82
- ] });
70
+ /* @__PURE__ */ t(
71
+ M,
72
+ {
73
+ onToggleView: r,
74
+ askAILabel: c,
75
+ searchLabel: o,
76
+ view: "chat"
77
+ }
78
+ ),
79
+ /* @__PURE__ */ t(d.Close, {})
80
+ ] }) : /* @__PURE__ */ t(d.Close, {}) });
83
81
  }
84
82
  function S() {
85
83
  return /* @__PURE__ */ t(e.Content, { children: /* @__PURE__ */ n(e.ContentScrollArea, { children: [
@@ -163,19 +161,19 @@ function y() {
163
161
  return /* @__PURE__ */ n(e.MessageSources, { children: [
164
162
  /* @__PURE__ */ t(e.MessageSourcesHeader, {}),
165
163
  /* @__PURE__ */ t(e.MessageSourcesList, { children: (a) => a.map((r, c) => /* @__PURE__ */ n(e.MessageSourceItem, { href: r.url, source: r, children: [
166
- /* @__PURE__ */ t(e.MessageSourceItemBreadcrumbs, { children: r.breadcrumbs?.map((o) => /* @__PURE__ */ n(m, { children: [
164
+ /* @__PURE__ */ t(e.MessageSourceItemBreadcrumbs, { children: r.breadcrumbs?.map((o) => /* @__PURE__ */ n(h, { children: [
167
165
  o,
168
166
  /* @__PURE__ */ t(e.MessageSourceItemBreadcrumbIcon, {})
169
167
  ] }, o)) }),
170
168
  /* @__PURE__ */ t(e.MessageSourceItemIcon, {}),
171
169
  /* @__PURE__ */ t(e.MessageSourceItemTitle, {}),
172
170
  /* @__PURE__ */ t(e.MessageSourceItemTag, {}),
173
- /* @__PURE__ */ t(e.MessageSourceItemDescription, { children: (o) => o.map((i, h) => /* @__PURE__ */ t(
171
+ /* @__PURE__ */ t(e.MessageSourceItemDescription, { children: (o) => o.map((i, F) => /* @__PURE__ */ t(
174
172
  e.MessageSourceItemDescriptionPart,
175
173
  {
176
174
  part: i
177
175
  },
178
- `part-${h}`
176
+ `part-${F}`
179
177
  )) }),
180
178
  /* @__PURE__ */ t(e.MessageSourceItemIndicator, {})
181
179
  ] }, c)) })
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("@inkeep/cxkit-styled"),i=require("react"),h=require("./widget-toggle.cjs"),S=require("./modal.cjs");function b(s){const{baseSettings:r,searchSettings:t}=s;return e.jsx(d.Shadow,{children:e.jsx(d.RootProvider,{config:{baseSettings:r,searchSettings:t},componentType:d.WebWidgetInteractionType.EmbeddedSearch,children:e.jsx(m,{...s})})})}function o(s){const{children:r,onToggleView:t,isHidden:n,shouldAutoFocusInput:c=!t}=s;return e.jsx(d.EmbeddedSearch.Provider,{isHidden:n,shouldAutoFocusInput:c,children:r})}function m(s){return e.jsx(o,{...s,children:e.jsx(u,{...s})})}function u(s){const{searchSettings:{view:r}}=d.useInkeepConfig(),{onToggleView:t,shouldShowAskAICard:n=!!t&&r!=="dual-pane"}=s,c=d.useModal(),a=d.useWidget(),l=c&&!a?S.ModalContent:i.Fragment;return e.jsx(l,{children:e.jsx(d.EmbeddedSearch.Wrapper,{"data-show-ask-ai-card":d.dataAttr(n),"data-composite":d.dataAttr(!!t||c?.isOpen),children:e.jsxs(d.EmbeddedSearch.Root,{children:[e.jsx(x,{...s}),e.jsxs(d.EmbeddedSearch.Content,{children:[e.jsx(j,{askAILabel:s.askAILabel,onToggleView:s.onToggleView,shouldShowAskAICard:n}),e.jsx(I,{})]}),e.jsx(R,{})]})})})}function x(s){const{onToggleView:r,askAILabel:t,searchLabel:n}=s,c=d.useCommandState(a=>a.search);return e.jsxs(d.EmbeddedSearch.InputGroup,{children:[e.jsx(d.EmbeddedSearch.InputIcon,{}),e.jsx(d.EmbeddedSearch.Input,{}),e.jsx(d.EmbeddedSearch.Loading,{}),r&&e.jsx(h.WidgetToggle,{onToggleView:r,query:c,askAILabel:t,searchLabel:n,view:"search"}),e.jsx(d.Modal.Close,{})]})}function j(s){const{askAILabel:r,onToggleView:t,shouldShowAskAICard:n}=s,c=d.useCommandState(l=>l.search),{handleToggle:a}=h.useToggleView({onToggleView:t,query:c});return n?e.jsxs(d.EmbeddedSearch.AskAITrigger,{onSelect:()=>a("chat",!0),children:[e.jsx(d.EmbeddedSearch.AskAITriggerIcon,{}),e.jsxs(d.EmbeddedSearch.AskAITriggerLabel,{children:[r||"Ask AI",c&&` "${c}"`]}),e.jsx(d.EmbeddedSearch.AskAITriggerIndicator,{})]}):null}function I(){return e.jsxs(d.EmbeddedSearch.Results,{children:[e.jsx(d.EmbeddedSearch.ResultsLoading,{}),e.jsx(d.EmbeddedSearch.ResultsTabList,{children:s=>s.map(r=>e.jsx(d.EmbeddedSearch.ResultsTab,{tab:r},r))}),e.jsx(d.EmbeddedSearch.ResultsEmpty,{}),e.jsxs(d.EmbeddedSearch.ResultsContent,{children:[e.jsx(E,{}),e.jsx(g,{})]})]})}function E(){return e.jsxs(d.EmbeddedSearch.ResultsScrollArea,{children:[e.jsx(d.EmbeddedSearch.ResultsScrollAreaViewport,{children:e.jsx(d.EmbeddedSearch.ResultsList,{children:s=>s.map(r=>e.jsxs(d.EmbeddedSearch.ResultsItem,{item:r,children:[e.jsx(d.EmbeddedSearch.ResultsItemBreadcrumbs,{children:t=>t.map((n,c)=>e.jsxs(i.Fragment,{children:[n,e.jsx(d.EmbeddedSearch.ResultsItemBreadcrumbIcon,{})]},`${n}-${c}`))}),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,{})]},r.id))})}),e.jsx(d.EmbeddedSearch.ResultsScrollAreaScrollbar,{children:e.jsx(d.EmbeddedSearch.ResultsScrollAreaThumb,{})}),e.jsx(d.EmbeddedSearch.ResultsScrollAreaCorner,{})]})}function g(){return e.jsxs(d.EmbeddedSearch.ResultsScrollArea,{children:[e.jsx(d.EmbeddedSearch.ResultsScrollAreaViewport,{children:e.jsxs(d.EmbeddedSearch.ResultsItemPreview,{children:[e.jsxs(d.EmbeddedSearch.ResultsItemPreviewHeader,{children:[e.jsxs(d.EmbeddedSearch.ResultsItemPreviewHeading,{children:[e.jsx(d.EmbeddedSearch.ResultsItemPreviewTitle,{}),e.jsx(d.EmbeddedSearch.ResultsItemPreviewTitleLinkIcon,{})]}),e.jsx(d.EmbeddedSearch.ResultsItemPreviewBreadcrumbs,{children:s=>s.map((r,t)=>e.jsxs(i.Fragment,{children:[r,e.jsx(d.EmbeddedSearch.ResultsItemPreviewBreadcrumbIcon,{})]},`${r}-${t}`))})]}),e.jsx(d.EmbeddedSearch.ResultsItemPreviewBody,{}),e.jsxs(d.EmbeddedSearch.ResultsItemPreviewOutline,{children:[e.jsx(d.EmbeddedSearch.ResultsItemPreviewOutlineTitle,{}),e.jsx(d.EmbeddedSearch.ResultsItemPreviewOutlineList,{children:s=>s.map((r,t)=>e.jsxs(d.EmbeddedSearch.ResultsItemPreviewOutlineItem,{href:r.url??void 0,"data-is-match":d.dataAttr(r.isMatch),children:[e.jsx(d.EmbeddedSearch.ResultsItemPreviewOutlineItemIcon,{}),e.jsx(d.EmbeddedSearch.ResultsItemPreviewOutlineItemText,{children:r.content}),r.url&&e.jsx(d.EmbeddedSearch.ResultsItemPreviewOutlineItemLinkIcon,{})]},`${r.anchor}-${t}`))})]})]})}),e.jsx(d.EmbeddedSearch.ResultsScrollAreaScrollbar,{children:e.jsx(d.EmbeddedSearch.ResultsScrollAreaThumb,{})}),e.jsx(d.EmbeddedSearch.ResultsScrollAreaCorner,{})]})}function R(){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=b;exports.InkeepEmbeddedSearchImpl=m;exports.InkeepEmbeddedSearchImplContent=u;exports.InkeepEmbeddedSearchProvider=o;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("@inkeep/cxkit-styled"),i=require("react"),h=require("./widget-toggle.cjs"),S=require("./modal.cjs");function b(s){const{baseSettings:r,searchSettings:t}=s;return e.jsx(d.Shadow,{children:e.jsx(d.RootProvider,{config:{baseSettings:r,searchSettings:t},componentType:d.WebWidgetInteractionType.EmbeddedSearch,children:e.jsx(m,{...s})})})}function o(s){const{children:r,onToggleView:t,isHidden:n,shouldAutoFocusInput:c=!t}=s;return e.jsx(d.EmbeddedSearch.Provider,{isHidden:n,shouldAutoFocusInput:c,children:r})}function m(s){return e.jsx(o,{...s,children:e.jsx(u,{...s})})}function u(s){const{searchSettings:{view:r}}=d.useInkeepConfig(),{onToggleView:t,shouldShowAskAICard:n=!!t&&r!=="dual-pane"}=s,c=d.useModal(),a=d.useWidget(),l=c&&!a?S.ModalContent:i.Fragment;return e.jsx(l,{children:e.jsx(d.EmbeddedSearch.Wrapper,{"data-show-ask-ai-card":d.dataAttr(n),"data-composite":d.dataAttr(!!t||c?.isOpen),children:e.jsxs(d.EmbeddedSearch.Root,{children:[e.jsx(x,{...s}),e.jsxs(d.EmbeddedSearch.Content,{children:[e.jsx(j,{askAILabel:s.askAILabel,onToggleView:s.onToggleView,shouldShowAskAICard:n}),e.jsx(I,{})]}),e.jsx(R,{})]})})})}function x(s){const{onToggleView:r,askAILabel:t,searchLabel:n}=s,c=d.useCommandState(a=>a.search);return e.jsxs(d.EmbeddedSearch.InputGroup,{children:[e.jsx(d.EmbeddedSearch.InputIcon,{}),e.jsx(d.EmbeddedSearch.Input,{}),e.jsx(d.EmbeddedSearch.Loading,{}),r&&e.jsx(h.WidgetToggle,{onToggleView:r,query:c,askAILabel:t,searchLabel:n,view:"search"}),e.jsx(d.Modal.Close,{})]})}function j(s){const{askAILabel:r,onToggleView:t,shouldShowAskAICard:n}=s,c=d.useCommandState(l=>l.search),{handleToggle:a}=h.useToggleView({onToggleView:t,query:c});return n?e.jsxs(d.EmbeddedSearch.AskAITrigger,{onSelect:()=>a("chat",!0),children:[e.jsx(d.EmbeddedSearch.AskAITriggerIcon,{}),e.jsxs(d.EmbeddedSearch.AskAITriggerLabel,{children:[r||"Ask AI",c&&e.jsx(d.EmbeddedSearch.AskAITriggerQuery,{children:`${c}`})]}),e.jsx(d.EmbeddedSearch.AskAITriggerIndicatorText,{children:"Start conversation"}),e.jsx(d.EmbeddedSearch.AskAITriggerIndicator,{})]}):null}function I(){return e.jsxs(d.EmbeddedSearch.Results,{children:[e.jsx(d.EmbeddedSearch.ResultsLoading,{}),e.jsx(d.EmbeddedSearch.ResultsTabList,{children:s=>s.map(r=>e.jsx(d.EmbeddedSearch.ResultsTab,{tab:r},r))}),e.jsx(d.EmbeddedSearch.ResultsEmpty,{}),e.jsxs(d.EmbeddedSearch.ResultsContent,{children:[e.jsx(E,{}),e.jsx(g,{})]})]})}function E(){return e.jsxs(d.EmbeddedSearch.ResultsScrollArea,{children:[e.jsx(d.EmbeddedSearch.ResultsScrollAreaViewport,{children:e.jsx(d.EmbeddedSearch.ResultsList,{children:s=>s.map(r=>e.jsxs(d.EmbeddedSearch.ResultsItem,{item:r,children:[e.jsx(d.EmbeddedSearch.ResultsItemBreadcrumbs,{children:t=>t.map((n,c)=>e.jsxs(i.Fragment,{children:[n,e.jsx(d.EmbeddedSearch.ResultsItemBreadcrumbIcon,{})]},`${n}-${c}`))}),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,{})]},r.id))})}),e.jsx(d.EmbeddedSearch.ResultsScrollAreaScrollbar,{children:e.jsx(d.EmbeddedSearch.ResultsScrollAreaThumb,{})}),e.jsx(d.EmbeddedSearch.ResultsScrollAreaCorner,{})]})}function g(){return e.jsxs(d.EmbeddedSearch.ResultsScrollArea,{children:[e.jsx(d.EmbeddedSearch.ResultsScrollAreaViewport,{children:e.jsxs(d.EmbeddedSearch.ResultsItemPreview,{children:[e.jsxs(d.EmbeddedSearch.ResultsItemPreviewHeader,{children:[e.jsxs(d.EmbeddedSearch.ResultsItemPreviewHeading,{children:[e.jsx(d.EmbeddedSearch.ResultsItemPreviewTitle,{}),e.jsx(d.EmbeddedSearch.ResultsItemPreviewTitleLinkIcon,{})]}),e.jsx(d.EmbeddedSearch.ResultsItemPreviewBreadcrumbs,{children:s=>s.map((r,t)=>e.jsxs(i.Fragment,{children:[r,e.jsx(d.EmbeddedSearch.ResultsItemPreviewBreadcrumbIcon,{})]},`${r}-${t}`))})]}),e.jsx(d.EmbeddedSearch.ResultsItemPreviewBody,{}),e.jsxs(d.EmbeddedSearch.ResultsItemPreviewOutline,{children:[e.jsx(d.EmbeddedSearch.ResultsItemPreviewOutlineTitle,{}),e.jsx(d.EmbeddedSearch.ResultsItemPreviewOutlineList,{children:s=>s.map((r,t)=>e.jsxs(d.EmbeddedSearch.ResultsItemPreviewOutlineItem,{href:r.url??void 0,"data-is-match":d.dataAttr(r.isMatch),children:[e.jsx(d.EmbeddedSearch.ResultsItemPreviewOutlineItemIcon,{}),e.jsx(d.EmbeddedSearch.ResultsItemPreviewOutlineItemText,{children:r.content}),r.url&&e.jsx(d.EmbeddedSearch.ResultsItemPreviewOutlineItemLinkIcon,{})]},`${r.anchor}-${t}`))})]})]})}),e.jsx(d.EmbeddedSearch.ResultsScrollAreaScrollbar,{children:e.jsx(d.EmbeddedSearch.ResultsScrollAreaThumb,{})}),e.jsx(d.EmbeddedSearch.ResultsScrollAreaCorner,{})]})}function R(){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=b;exports.InkeepEmbeddedSearchImpl=m;exports.InkeepEmbeddedSearchImplContent=u;exports.InkeepEmbeddedSearchProvider=o;
@@ -1,12 +1,12 @@
1
1
  "use client";
2
2
  import { jsx as t, jsxs as s } from "react/jsx-runtime";
3
- import { Shadow as I, RootProvider as m, WebWidgetInteractionType as g, EmbeddedSearch as e, useInkeepConfig as R, useModal as p, useWidget as w, dataAttr as u, useCommandState as h, Modal as A } from "@inkeep/cxkit-styled";
3
+ import { Shadow as h, RootProvider as m, WebWidgetInteractionType as g, EmbeddedSearch as e, useInkeepConfig as R, useModal as A, useWidget as p, dataAttr as u, useCommandState as I, Modal as T } from "@inkeep/cxkit-styled";
4
4
  import { Fragment as d } from "react";
5
- import { WidgetToggle as T, useToggleView as S } from "./widget-toggle.js";
5
+ import { WidgetToggle as w, useToggleView as S } from "./widget-toggle.js";
6
6
  import { ModalContent as v } from "./modal.js";
7
7
  function F(n) {
8
8
  const { baseSettings: r, searchSettings: l } = n;
9
- return /* @__PURE__ */ t(I, { children: /* @__PURE__ */ t(
9
+ return /* @__PURE__ */ t(h, { children: /* @__PURE__ */ t(
10
10
  m,
11
11
  {
12
12
  config: {
@@ -28,7 +28,7 @@ function P(n) {
28
28
  function b(n) {
29
29
  const {
30
30
  searchSettings: { view: r }
31
- } = R(), { onToggleView: l, shouldShowAskAICard: o = !!l && r !== "dual-pane" } = n, i = p(), c = w();
31
+ } = R(), { onToggleView: l, shouldShowAskAICard: o = !!l && r !== "dual-pane" } = n, i = A(), c = p();
32
32
  return /* @__PURE__ */ t(i && !c ? v : d, { children: /* @__PURE__ */ t(
33
33
  e.Wrapper,
34
34
  {
@@ -53,13 +53,13 @@ function b(n) {
53
53
  ) });
54
54
  }
55
55
  function f(n) {
56
- const { onToggleView: r, askAILabel: l, searchLabel: o } = n, i = h((c) => c.search);
56
+ const { onToggleView: r, askAILabel: l, searchLabel: o } = n, i = I((c) => c.search);
57
57
  return /* @__PURE__ */ s(e.InputGroup, { children: [
58
58
  /* @__PURE__ */ t(e.InputIcon, {}),
59
59
  /* @__PURE__ */ t(e.Input, {}),
60
60
  /* @__PURE__ */ t(e.Loading, {}),
61
61
  r && /* @__PURE__ */ t(
62
- T,
62
+ w,
63
63
  {
64
64
  onToggleView: r,
65
65
  query: i,
@@ -68,11 +68,11 @@ function f(n) {
68
68
  view: "search"
69
69
  }
70
70
  ),
71
- /* @__PURE__ */ t(A.Close, {})
71
+ /* @__PURE__ */ t(T.Close, {})
72
72
  ] });
73
73
  }
74
74
  function L(n) {
75
- const { askAILabel: r, onToggleView: l, shouldShowAskAICard: o } = n, i = h((a) => a.search), { handleToggle: c } = S({
75
+ const { askAILabel: r, onToggleView: l, shouldShowAskAICard: o } = n, i = I((a) => a.search), { handleToggle: c } = S({
76
76
  onToggleView: l,
77
77
  query: i
78
78
  });
@@ -80,8 +80,9 @@ function L(n) {
80
80
  /* @__PURE__ */ t(e.AskAITriggerIcon, {}),
81
81
  /* @__PURE__ */ s(e.AskAITriggerLabel, { children: [
82
82
  r || "Ask AI",
83
- i && ` "${i}"`
83
+ i && /* @__PURE__ */ t(e.AskAITriggerQuery, { children: `${i}` })
84
84
  ] }),
85
+ /* @__PURE__ */ t(e.AskAITriggerIndicatorText, { children: "Start conversation" }),
85
86
  /* @__PURE__ */ t(e.AskAITriggerIndicator, {})
86
87
  ] }) : null;
87
88
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/cxkit-react",
3
- "version": "0.5.70",
3
+ "version": "0.5.72",
4
4
  "description": "",
5
5
  "license": "Inkeep, Inc. Customer License (IICL) v1.1",
6
6
  "homepage": "",
@@ -21,7 +21,7 @@
21
21
  "sideEffects": false,
22
22
  "dependencies": {
23
23
  "@radix-ui/react-use-controllable-state": "^1.1.0",
24
- "@inkeep/cxkit-styled": "0.5.70"
24
+ "@inkeep/cxkit-styled": "0.5.72"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@biomejs/biome": "1.9.4",
@@ -44,8 +44,8 @@
44
44
  "typescript": "5.7.3",
45
45
  "vite": "5.4.11",
46
46
  "vite-plugin-dts": "4.4.0",
47
- "@inkeep/cxkit-color-mode": "0.5.70",
48
- "@inkeep/cxkit-types": "0.5.70"
47
+ "@inkeep/cxkit-color-mode": "0.5.72",
48
+ "@inkeep/cxkit-types": "0.5.72"
49
49
  },
50
50
  "module": "dist/index.js",
51
51
  "types": "dist/index.d.ts",