@inkeep/cxkit-react 0.0.0-dev-20250311162854 → 0.0.0-dev-20250312233023

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