@inkeep/cxkit-react 0.0.0-dev-20250221234142
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +1 -0
- package/dist/components/chat-button.cjs +1 -0
- package/dist/components/chat-button.d.cts +14 -0
- package/dist/components/chat-button.d.ts +14 -0
- package/dist/components/chat-button.js +54 -0
- package/dist/components/embedded-chat.cjs +1 -0
- package/dist/components/embedded-chat.d.cts +8 -0
- package/dist/components/embedded-chat.d.ts +8 -0
- package/dist/components/embedded-chat.js +340 -0
- package/dist/components/embedded-search-and-chat.cjs +1 -0
- package/dist/components/embedded-search-and-chat.d.cts +40 -0
- package/dist/components/embedded-search-and-chat.d.ts +40 -0
- package/dist/components/embedded-search-and-chat.impl.cjs +1 -0
- package/dist/components/embedded-search-and-chat.impl.d.cts +9 -0
- package/dist/components/embedded-search-and-chat.impl.d.ts +9 -0
- package/dist/components/embedded-search-and-chat.impl.js +43 -0
- package/dist/components/embedded-search-and-chat.js +65 -0
- package/dist/components/embedded-search.cjs +1 -0
- package/dist/components/embedded-search.d.cts +14 -0
- package/dist/components/embedded-search.d.ts +14 -0
- package/dist/components/embedded-search.js +99 -0
- package/dist/components/index.cjs +1 -0
- package/dist/components/index.d.cts +10 -0
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.js +28 -0
- package/dist/components/intelligent-form.cjs +1 -0
- package/dist/components/intelligent-form.d.cts +8 -0
- package/dist/components/intelligent-form.d.ts +8 -0
- package/dist/components/intelligent-form.js +130 -0
- package/dist/components/modal.chat.cjs +1 -0
- package/dist/components/modal.chat.d.cts +6 -0
- package/dist/components/modal.chat.d.ts +6 -0
- package/dist/components/modal.chat.js +21 -0
- package/dist/components/modal.cjs +1 -0
- package/dist/components/modal.d.cts +21 -0
- package/dist/components/modal.d.ts +21 -0
- package/dist/components/modal.js +19 -0
- package/dist/components/modal.search-and-chat.cjs +1 -0
- package/dist/components/modal.search-and-chat.d.cts +6 -0
- package/dist/components/modal.search-and-chat.d.ts +6 -0
- package/dist/components/modal.search-and-chat.js +27 -0
- package/dist/components/modal.search.cjs +1 -0
- package/dist/components/modal.search.d.cts +6 -0
- package/dist/components/modal.search.d.ts +6 -0
- package/dist/components/modal.search.js +21 -0
- package/dist/components/searchbar.cjs +1 -0
- package/dist/components/searchbar.d.cts +13 -0
- package/dist/components/searchbar.d.ts +13 -0
- package/dist/components/searchbar.js +60 -0
- package/dist/components/widget-toggle.cjs +1 -0
- package/dist/components/widget-toggle.d.cts +14 -0
- package/dist/components/widget-toggle.d.ts +14 -0
- package/dist/components/widget-toggle.js +62 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +29 -0
- package/dist/utils.cjs +1 -0
- package/dist/utils.d.cts +6 -0
- package/dist/utils.d.ts +6 -0
- package/dist/utils.js +20 -0
- package/package.json +73 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { InkeepEmbeddedSearchImpl as m } from "./embedded-search.js";
|
|
4
|
+
import { InkeepModal as p } from "./modal.js";
|
|
5
|
+
import { WebWidgetInteractionType as s } from "@inkeep/cxkit-styled";
|
|
6
|
+
function l(t) {
|
|
7
|
+
const { modalSettings: r, baseSettings: o, searchSettings: n, ...i } = t;
|
|
8
|
+
return /* @__PURE__ */ e(
|
|
9
|
+
p,
|
|
10
|
+
{
|
|
11
|
+
interactionType: s.CustomTrigger,
|
|
12
|
+
modalSettings: r,
|
|
13
|
+
baseSettings: o,
|
|
14
|
+
searchSettings: n,
|
|
15
|
+
children: /* @__PURE__ */ e(m, { shouldAutoFocusInput: !0, ...i })
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
l as InkeepModalSearch
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),p=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[s,t]=p.useState(!1),{modalSettings:n,defaultView:c="search",canToggleView:u=!0,...o}=a,{config:i,...h}=m.useWidgetImpl({...o,defaultView:c}),d={shortcutKey:"k",...n,open:s,onOpenChange:S=>{a.forceDefaultView&&!S&&h.setView(c??"search"),t(!!S)}};return e.jsxs(e.Fragment,{children:[e.jsx(r.Shadow,{wrapperStyles:{display:"contents"},children:e.jsx(r.RootProvider,{config:i,interactionType:r.WebWidgetInteractionType.SearchBar,children:e.jsx(l,{setOpen:t,modalSettings:d})})}),e.jsx(j.InkeepModal,{...i,modalSettings:d,interactionType:r.WebWidgetInteractionType.SearchBar,children:u?e.jsx(B.InkeepEmbeddedSearchAndChatImpl,{...h}):e.jsx(x.InkeepEmbeddedSearchImpl,{...o})})]})}function l(a){const{setOpen:s,modalSettings:t}=a;return e.jsx(r.SearchBar.SearchBarContainer,{children:e.jsxs(r.SearchBar.SearchBarButton,{onPointerDown:n=>{n.button!==2&&(s(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;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { InkeepModalSettings } from '@inkeep/cxkit-types';
|
|
2
|
+
import { InkeepEmbeddedSearchAndChatProps } from './embedded-search-and-chat';
|
|
3
|
+
export interface InkeepSearchBarProps extends Omit<InkeepEmbeddedSearchAndChatProps, 'onToggleView'> {
|
|
4
|
+
modalSettings?: Omit<InkeepModalSettings, 'open' | 'onOpenChange'>;
|
|
5
|
+
canToggleView?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function InkeepSearchBar(props: InkeepSearchBarProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
interface SearchBarImplProps {
|
|
9
|
+
setOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
10
|
+
modalSettings: InkeepSearchBarProps['modalSettings'];
|
|
11
|
+
}
|
|
12
|
+
export declare function SearchBarImpl(props: SearchBarImplProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { InkeepModalSettings } from '@inkeep/cxkit-types';
|
|
2
|
+
import { InkeepEmbeddedSearchAndChatProps } from './embedded-search-and-chat';
|
|
3
|
+
export interface InkeepSearchBarProps extends Omit<InkeepEmbeddedSearchAndChatProps, 'onToggleView'> {
|
|
4
|
+
modalSettings?: Omit<InkeepModalSettings, 'open' | 'onOpenChange'>;
|
|
5
|
+
canToggleView?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function InkeepSearchBar(props: InkeepSearchBarProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
interface SearchBarImplProps {
|
|
9
|
+
setOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
10
|
+
modalSettings: InkeepSearchBarProps['modalSettings'];
|
|
11
|
+
}
|
|
12
|
+
export declare function SearchBarImpl(props: SearchBarImplProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as c, Fragment as u, jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { useState as f } from "react";
|
|
4
|
+
import { InkeepEmbeddedSearchAndChatImpl as B } from "./embedded-search-and-chat.js";
|
|
5
|
+
import { useWidgetImpl as g } from "./embedded-search-and-chat.impl.js";
|
|
6
|
+
import { InkeepEmbeddedSearchImpl as y } from "./embedded-search.js";
|
|
7
|
+
import { Shadow as I, RootProvider as K, WebWidgetInteractionType as l, SearchBar as r } from "@inkeep/cxkit-styled";
|
|
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",
|
|
13
|
+
canToggleView: S = !0,
|
|
14
|
+
...h
|
|
15
|
+
} = n, { config: p, ...s } = g({ ...h, defaultView: a }), d = {
|
|
16
|
+
shortcutKey: "k",
|
|
17
|
+
...o,
|
|
18
|
+
open: i,
|
|
19
|
+
onOpenChange: (m) => {
|
|
20
|
+
n.forceDefaultView && !m && s.setView(a ?? "search"), t(!!m);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
return /* @__PURE__ */ c(u, { children: [
|
|
24
|
+
/* @__PURE__ */ e(I, { wrapperStyles: { display: "contents" }, children: /* @__PURE__ */ e(K, { config: p, interactionType: l.SearchBar, children: /* @__PURE__ */ e(w, { setOpen: t, modalSettings: d }) }) }),
|
|
25
|
+
/* @__PURE__ */ e(
|
|
26
|
+
b,
|
|
27
|
+
{
|
|
28
|
+
...p,
|
|
29
|
+
modalSettings: d,
|
|
30
|
+
interactionType: l.SearchBar,
|
|
31
|
+
children: S ? /* @__PURE__ */ e(B, { ...s }) : /* @__PURE__ */ e(y, { ...h })
|
|
32
|
+
}
|
|
33
|
+
)
|
|
34
|
+
] });
|
|
35
|
+
}
|
|
36
|
+
function w(n) {
|
|
37
|
+
const { setOpen: i, modalSettings: t } = n;
|
|
38
|
+
return /* @__PURE__ */ e(r.SearchBarContainer, { children: /* @__PURE__ */ c(
|
|
39
|
+
r.SearchBarButton,
|
|
40
|
+
{
|
|
41
|
+
onPointerDown: (o) => {
|
|
42
|
+
o.button !== 2 && (i((a) => !a), o.stopPropagation());
|
|
43
|
+
},
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ c(r.SearchBarContentWrapper, { children: [
|
|
46
|
+
/* @__PURE__ */ e(r.SearchBarIcon, {}),
|
|
47
|
+
/* @__PURE__ */ e(r.SearchBarText, {})
|
|
48
|
+
] }),
|
|
49
|
+
/* @__PURE__ */ c(r.SearchBarKbdWrapper, { children: [
|
|
50
|
+
/* @__PURE__ */ e(r.SearchBarKbdModifier, { shortcutKey: t?.shortcutKey }),
|
|
51
|
+
/* @__PURE__ */ e(r.SearchBarKbdShortcutKey, { shortcutKey: t?.shortcutKey })
|
|
52
|
+
] })
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
) });
|
|
56
|
+
}
|
|
57
|
+
export {
|
|
58
|
+
j as InkeepSearchBar,
|
|
59
|
+
w as SearchBarImpl
|
|
60
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),e=require("@inkeep/cxkit-styled"),d=e.ikp("div",{_id:"view_toggle"}),a=e.ikp("button",{_id:"view_toggle_button",className:e.widgetToggle({slot:"button"})}),c=e.ikp(e.CustomIcon,{_id:"view_toggle_icon"});function r(t){const{handleToggle:o}=g(t);return i.jsxs(d,{className:e.widgetToggle({slot:"root"}),children:[i.jsxs(a,{onClick:()=>o("search"),"data-active":e.dataAttr(t.view==="search"),children:[i.jsx(c,{"data-active":e.dataAttr(t.view==="search"),iconKey:"switchToSearch",className:e.widgetToggle({slot:"icon"})}),t.searchLabel||"Search"]}),i.jsxs(a,{onClick:()=>o("chat"),"data-active":e.dataAttr(t.view==="chat"),children:[i.jsx(c,{"data-active":e.dataAttr(t.view==="chat"),iconKey:"switchToChat",className:e.widgetToggle({slot:"icon"})}),t.askAILabel||"Ask AI"]})]})}function g(t){const{onToggleView:o,query:l}=t;return{handleToggle:(n,s)=>{o?.({view:n,query:l,autoSubmit:s})}}}exports.WidgetToggle=r;exports.useToggleView=g;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ModalViewTypes, OnToggleView } from '@inkeep/cxkit-types';
|
|
2
|
+
export declare function WidgetToggle(props: {
|
|
3
|
+
onToggleView: OnToggleView;
|
|
4
|
+
query?: string;
|
|
5
|
+
askAILabel?: string;
|
|
6
|
+
searchLabel?: string;
|
|
7
|
+
view: ModalViewTypes;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function useToggleView(props: {
|
|
10
|
+
onToggleView?: OnToggleView;
|
|
11
|
+
query?: string;
|
|
12
|
+
}): {
|
|
13
|
+
handleToggle: (view: ModalViewTypes, autoSubmit?: boolean) => void;
|
|
14
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ModalViewTypes, OnToggleView } from '@inkeep/cxkit-types';
|
|
2
|
+
export declare function WidgetToggle(props: {
|
|
3
|
+
onToggleView: OnToggleView;
|
|
4
|
+
query?: string;
|
|
5
|
+
askAILabel?: string;
|
|
6
|
+
searchLabel?: string;
|
|
7
|
+
view: ModalViewTypes;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function useToggleView(props: {
|
|
10
|
+
onToggleView?: OnToggleView;
|
|
11
|
+
query?: string;
|
|
12
|
+
}): {
|
|
13
|
+
handleToggle: (view: ModalViewTypes, autoSubmit?: boolean) => void;
|
|
14
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as i, jsx as n } from "react/jsx-runtime";
|
|
3
|
+
import { ikp as a, widgetToggle as c, dataAttr as o, CustomIcon as r } from "@inkeep/cxkit-styled";
|
|
4
|
+
const w = a("div", {
|
|
5
|
+
_id: "view_toggle"
|
|
6
|
+
}), l = a("button", {
|
|
7
|
+
_id: "view_toggle_button",
|
|
8
|
+
className: c({ slot: "button" })
|
|
9
|
+
}), g = a(r, {
|
|
10
|
+
_id: "view_toggle_icon"
|
|
11
|
+
});
|
|
12
|
+
function _(e) {
|
|
13
|
+
const { handleToggle: t } = u(e);
|
|
14
|
+
return /* @__PURE__ */ i(w, { className: c({ slot: "root" }), children: [
|
|
15
|
+
/* @__PURE__ */ i(
|
|
16
|
+
l,
|
|
17
|
+
{
|
|
18
|
+
onClick: () => t("search"),
|
|
19
|
+
"data-active": o(e.view === "search"),
|
|
20
|
+
children: [
|
|
21
|
+
/* @__PURE__ */ n(
|
|
22
|
+
g,
|
|
23
|
+
{
|
|
24
|
+
"data-active": o(e.view === "search"),
|
|
25
|
+
iconKey: "switchToSearch",
|
|
26
|
+
className: c({ slot: "icon" })
|
|
27
|
+
}
|
|
28
|
+
),
|
|
29
|
+
e.searchLabel || "Search"
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
),
|
|
33
|
+
/* @__PURE__ */ i(
|
|
34
|
+
l,
|
|
35
|
+
{
|
|
36
|
+
onClick: () => t("chat"),
|
|
37
|
+
"data-active": o(e.view === "chat"),
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ n(
|
|
40
|
+
g,
|
|
41
|
+
{
|
|
42
|
+
"data-active": o(e.view === "chat"),
|
|
43
|
+
iconKey: "switchToChat",
|
|
44
|
+
className: c({ slot: "icon" })
|
|
45
|
+
}
|
|
46
|
+
),
|
|
47
|
+
e.askAILabel || "Ask AI"
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
)
|
|
51
|
+
] });
|
|
52
|
+
}
|
|
53
|
+
function u(e) {
|
|
54
|
+
const { onToggleView: t, query: s } = e;
|
|
55
|
+
return { handleToggle: (h, d) => {
|
|
56
|
+
t?.({ view: h, query: s, autoSubmit: d });
|
|
57
|
+
} };
|
|
58
|
+
}
|
|
59
|
+
export {
|
|
60
|
+
_ as WidgetToggle,
|
|
61
|
+
u as useToggleView
|
|
62
|
+
};
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +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]})});
|
package/dist/index.d.cts
ADDED
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
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";
|
|
11
|
+
export * from "@inkeep/cxkit-styled";
|
|
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
|
|
29
|
+
};
|
package/dist/utils.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function s(e,n){typeof e=="function"?e(n):e!=null&&(e.current=n)}function u(...e){return n=>{for(const t of e)s(t,n)}}function c(e,n,{checkForDefaultPrevented:t=!0}={}){return function(o){if(e?.(o),t===!1||!o.defaultPrevented)return n?.(o)}}exports.composeEventHandlers=c;exports.composeRefs=u;
|
package/dist/utils.d.cts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type PossibleRef<T> = React.Ref<T | null> | undefined;
|
|
2
|
+
export declare function composeRefs<T>(...refs: PossibleRef<T>[]): (node: T | null) => void;
|
|
3
|
+
export declare function composeEventHandlers<E>(originalEventHandler?: (event: E) => void, ourEventHandler?: (event: E) => void, { checkForDefaultPrevented }?: {
|
|
4
|
+
checkForDefaultPrevented?: boolean | undefined;
|
|
5
|
+
}): (event: E) => void;
|
|
6
|
+
export {};
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type PossibleRef<T> = React.Ref<T | null> | undefined;
|
|
2
|
+
export declare function composeRefs<T>(...refs: PossibleRef<T>[]): (node: T | null) => void;
|
|
3
|
+
export declare function composeEventHandlers<E>(originalEventHandler?: (event: E) => void, ourEventHandler?: (event: E) => void, { checkForDefaultPrevented }?: {
|
|
4
|
+
checkForDefaultPrevented?: boolean | undefined;
|
|
5
|
+
}): (event: E) => void;
|
|
6
|
+
export {};
|
package/dist/utils.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
function f(n, e) {
|
|
3
|
+
typeof n == "function" ? n(e) : n != null && (n.current = e);
|
|
4
|
+
}
|
|
5
|
+
function c(...n) {
|
|
6
|
+
return (e) => {
|
|
7
|
+
for (const t of n)
|
|
8
|
+
f(t, e);
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
function i(n, e, { checkForDefaultPrevented: t = !0 } = {}) {
|
|
12
|
+
return function(o) {
|
|
13
|
+
if (n?.(o), t === !1 || !o.defaultPrevented)
|
|
14
|
+
return e?.(o);
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
i as composeEventHandlers,
|
|
19
|
+
c as composeRefs
|
|
20
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@inkeep/cxkit-react",
|
|
3
|
+
"version": "0.0.0-dev-20250221234142",
|
|
4
|
+
"description": "",
|
|
5
|
+
"license": "Inkeep, Inc. Customer License (IICL) v1.1",
|
|
6
|
+
"homepage": "",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/inkeep/widget",
|
|
10
|
+
"directory": "packages/closed"
|
|
11
|
+
},
|
|
12
|
+
"type": "module",
|
|
13
|
+
"main": "dist/index.cjs",
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"clean-package": "../../clean-package.config.json",
|
|
18
|
+
"publishConfig": {
|
|
19
|
+
"access": "public"
|
|
20
|
+
},
|
|
21
|
+
"sideEffects": false,
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@inkeep/cxkit-styled": "0.0.0-dev-20250221234142"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@biomejs/biome": "1.9.4",
|
|
27
|
+
"@chromatic-com/storybook": "^3",
|
|
28
|
+
"@radix-ui/react-select": "2.1.4",
|
|
29
|
+
"@storybook/addon-a11y": "^8.5.3",
|
|
30
|
+
"@storybook/addon-essentials": "^8.5.3",
|
|
31
|
+
"@storybook/react": "^8.5.3",
|
|
32
|
+
"@storybook/react-vite": "^8.5.3",
|
|
33
|
+
"@types/react": "19.0.7",
|
|
34
|
+
"@types/react-dom": "19.0.3",
|
|
35
|
+
"@vitejs/plugin-react": "4.3.4",
|
|
36
|
+
"clean-package": "2.2.0",
|
|
37
|
+
"globby": "14.0.2",
|
|
38
|
+
"prism-react-renderer": "2.4.1",
|
|
39
|
+
"react": "19.0.0",
|
|
40
|
+
"react-dom": "19.0.0",
|
|
41
|
+
"react-icons": "5.4.0",
|
|
42
|
+
"storybook": "^8.5.3",
|
|
43
|
+
"typescript": "5.7.3",
|
|
44
|
+
"vite": "5.4.11",
|
|
45
|
+
"vite-plugin-dts": "4.4.0",
|
|
46
|
+
"@inkeep/cxkit-color-mode": "0.0.0-dev-20250221234142",
|
|
47
|
+
"@inkeep/cxkit-types": "0.0.0-dev-20250221234142"
|
|
48
|
+
},
|
|
49
|
+
"module": "dist/index.js",
|
|
50
|
+
"types": "dist/index.d.ts",
|
|
51
|
+
"exports": {
|
|
52
|
+
".": {
|
|
53
|
+
"source": "./src/index.ts",
|
|
54
|
+
"import": {
|
|
55
|
+
"types": "./dist/index.d.ts",
|
|
56
|
+
"default": "./dist/index.js"
|
|
57
|
+
},
|
|
58
|
+
"require": {
|
|
59
|
+
"types": "./dist/index.d.cts",
|
|
60
|
+
"default": "./dist/index.cjs"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"./package.json": "./package.json"
|
|
64
|
+
},
|
|
65
|
+
"scripts": {
|
|
66
|
+
"build": "vite build",
|
|
67
|
+
"watch": "vite build --watch",
|
|
68
|
+
"dev": "pnpm storybook",
|
|
69
|
+
"lint": "biome lint ./src",
|
|
70
|
+
"typecheck": "tsc",
|
|
71
|
+
"storybook": "storybook dev -p 6006"
|
|
72
|
+
}
|
|
73
|
+
}
|