@inkeep/cxkit-primitives 0.5.48 → 0.5.49
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/dist/atoms/cmdk/index.cjs +1 -1
- package/dist/atoms/cmdk/index.js +183 -183
- package/dist/atoms/dialog.cjs +1 -1
- package/dist/atoms/dialog.js +130 -131
- package/dist/index.d.cts +6 -9
- package/dist/index.d.ts +6 -9
- package/dist/providers/base-events-provider.cjs +1 -1
- package/dist/providers/base-events-provider.js +1 -1
- package/package.json +8 -8
package/dist/atoms/dialog.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),T=require("react"),p=require("@radix-ui/primitive"),P=require("@radix-ui/react-compose-refs"),H=require("@radix-ui/react-context"),m=require("@radix-ui/react-id"),z=require("@radix-ui/react-use-controllable-state"),K=require("@radix-ui/react-dismissable-layer"),U=require("@zag-js/focus-trap"),V=require("@radix-ui/react-portal"),_=require("@radix-ui/react-presence"),g=require("@radix-ui/react-primitive"),Y=require("@radix-ui/react-focus-guards"),Z=require("react-remove-scroll"),B=require("aria-hidden"),J=require("@radix-ui/react-slot");function Q(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,s.get?s:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const c=Q(T),x="Dialog",[N,W]=H.createContextScope(x),[X,l]=N(x),O=e=>{const{__scopeDialog:n,children:t,open:s,defaultOpen:o,onOpenChange:r,modal:a=!0}=e,u=c.useRef(null),f=c.useRef(null),[R=!1,C]=z.useControllableState({prop:s,defaultProp:o,onChange:r});return i.jsx(X,{scope:n,triggerRef:u,contentRef:f,contentId:m.useId(),titleId:m.useId(),descriptionId:m.useId(),open:R,onOpenChange:C,onOpenToggle:c.useCallback(()=>C(G=>!G),[C]),modal:a,children:t})};O.displayName=x;const M="DialogTrigger",S=c.forwardRef((e,n)=>{const{__scopeDialog:t,...s}=e,o=l(M,t),r=P.useComposedRefs(n,o.triggerRef);return i.jsx(g.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":j(o.open),...s,ref:r,onClick:p.composeEventHandlers(e.onClick,o.onOpenToggle)})});S.displayName=M;const v="DialogPortal",[$,q]=N(v,{forceMount:void 0}),y=e=>{const{__scopeDialog:n,forceMount:t,children:s,container:o}=e,r=l(v,n);return i.jsx($,{scope:n,forceMount:t,children:c.Children.map(s,a=>i.jsx(_.Presence,{present:t||r.open,children:i.jsx(V.Portal,{asChild:!0,container:o,children:a})}))})};y.displayName=v;const D="DialogOverlay",E=c.forwardRef((e,n)=>{const t=q(D,e.__scopeDialog),{forceMount:s=t.forceMount,...o}=e,r=l(D,e.__scopeDialog);return r.modal?i.jsx(_.Presence,{present:s||r.open,children:i.jsx(ee,{...o,ref:n})}):null});E.displayName=D;const ee=c.forwardRef((e,n)=>{const{__scopeDialog:t,...s}=e,o=l(D,t);return i.jsx(Z.RemoveScroll,{as:J.Slot,allowPinchZoom:!0,shards:[o.contentRef],children:i.jsx(g.Primitive.div,{"data-state":j(o.open),...s,ref:n,style:{pointerEvents:"auto",...s.style}})})}),d="DialogContent",b=c.forwardRef((e,n)=>{const t=q(d,e.__scopeDialog),{forceMount:s=t.forceMount,...o}=e,r=l(d,e.__scopeDialog);return i.jsx(_.Presence,{present:s||r.open,children:r.modal?i.jsx(te,{...o,ref:n}):i.jsx(oe,{...o,ref:n})})});b.displayName=d;const te=c.forwardRef((e,n)=>{const t=l(d,e.__scopeDialog),s=c.useRef(null),o=P.useComposedRefs(n,t.contentRef,s);return c.useEffect(()=>{const r=s.current;if(r)return B.hideOthers(r)},[]),i.jsx(w,{...e,ref:o,trapFocus:t.open,disableOutsidePointerEvents:!0,onPointerDownOutside:p.composeEventHandlers(e.onPointerDownOutside,r=>{const a=r.detail.originalEvent,u=a.button===0&&a.ctrlKey===!0;(a.button===2||u)&&r.preventDefault()}),onFocusOutside:p.composeEventHandlers(e.onFocusOutside,r=>r.preventDefault())})}),oe=c.forwardRef((e,n)=>{const t=l(d,e.__scopeDialog),s=c.useRef(!1),o=c.useRef(!1);return i.jsx(w,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onInteractOutside:r=>{e.onInteractOutside?.(r),r.defaultPrevented||(s.current=!0,r.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=r.target;t.triggerRef.current?.contains(a)&&r.preventDefault(),r.detail.originalEvent.type==="focusin"&&o.current&&r.preventDefault()}})}),w=c.forwardRef((e,n)=>{const{__scopeDialog:t,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:r,...a}=e,u=l(d,t),f=c.useRef(null),R=P.useComposedRefs(n,f);return Y.useFocusGuards(),T.useEffect(()=>{if(s)return U.trapFocus(f.current,{preventScroll:!0,onActivate:o,onDeactivate:r})},[]),i.jsx(K.DismissableLayer,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":j(u.open),...a,ref:R,onDismiss:()=>u.onOpenChange(!1)})}),A="DialogTitle",h=c.forwardRef((e,n)=>{const{__scopeDialog:t,...s}=e,o=l(A,t);return i.jsx(g.Primitive.h2,{id:o.titleId,...s,ref:n})});h.displayName=A;const F="DialogDescription",k=c.forwardRef((e,n)=>{const{__scopeDialog:t,...s}=e,o=l(F,t);return i.jsx(g.Primitive.p,{id:o.descriptionId,...s,ref:n})});k.displayName=F;const L="DialogClose",I=c.forwardRef((e,n)=>{const{__scopeDialog:t,...s}=e,o=l(L,t);return i.jsx(g.Primitive.button,{type:"button",...s,ref:n,onClick:p.composeEventHandlers(e.onClick,()=>o.onOpenChange(!1))})});I.displayName=L;function j(e){return e?"open":"closed"}const ne=O,re=y,se=E,ce=b,ie=h,ae=I;exports.Close=ae;exports.Content=ce;exports.Dialog=O;exports.DialogClose=I;exports.DialogContent=b;exports.DialogDescription=k;exports.DialogOverlay=E;exports.DialogPortal=y;exports.DialogTitle=h;exports.DialogTrigger=S;exports.Overlay=se;exports.Portal=re;exports.Root=ne;exports.Title=ie;exports.createDialogScope=W;
|
package/dist/atoms/dialog.js
CHANGED
|
@@ -1,216 +1,215 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as i
|
|
2
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
3
3
|
import * as c from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { useEffect as G } from "react";
|
|
5
|
+
import { composeEventHandlers as g } from "@radix-ui/primitive";
|
|
5
6
|
import { useComposedRefs as _ } from "@radix-ui/react-compose-refs";
|
|
6
|
-
import { createContextScope as
|
|
7
|
+
import { createContextScope as $ } from "@radix-ui/react-context";
|
|
7
8
|
import { useId as C } from "@radix-ui/react-id";
|
|
8
|
-
import { useControllableState as
|
|
9
|
-
import { DismissableLayer as
|
|
10
|
-
import {
|
|
11
|
-
import "@radix-ui/react-portal";
|
|
12
|
-
import { Presence as
|
|
13
|
-
import { Primitive as
|
|
14
|
-
import { useFocusGuards as
|
|
15
|
-
import { RemoveScroll as
|
|
16
|
-
import { hideOthers as
|
|
17
|
-
import { Slot as
|
|
18
|
-
const
|
|
19
|
-
const { __scopeDialog:
|
|
20
|
-
prop:
|
|
9
|
+
import { useControllableState as j } from "@radix-ui/react-use-controllable-state";
|
|
10
|
+
import { DismissableLayer as H } from "@radix-ui/react-dismissable-layer";
|
|
11
|
+
import { trapFocus as K } from "@zag-js/focus-trap";
|
|
12
|
+
import { Portal as V } from "@radix-ui/react-portal";
|
|
13
|
+
import { Presence as O } from "@radix-ui/react-presence";
|
|
14
|
+
import { Primitive as d } from "@radix-ui/react-primitive";
|
|
15
|
+
import { useFocusGuards as Y } from "@radix-ui/react-focus-guards";
|
|
16
|
+
import { RemoveScroll as Z } from "react-remove-scroll";
|
|
17
|
+
import { hideOthers as q } from "aria-hidden";
|
|
18
|
+
import { Slot as z } from "@radix-ui/react-slot";
|
|
19
|
+
const P = "Dialog", [E, Co] = $(P), [B, l] = E(P), I = (o) => {
|
|
20
|
+
const { __scopeDialog: n, children: r, open: s, defaultOpen: t, onOpenChange: e, modal: a = !0 } = o, f = c.useRef(null), p = c.useRef(null), [D = !1, R] = j({
|
|
21
|
+
prop: s,
|
|
21
22
|
defaultProp: t,
|
|
22
23
|
onChange: e
|
|
23
24
|
});
|
|
24
25
|
return /* @__PURE__ */ i(
|
|
25
|
-
|
|
26
|
+
B,
|
|
26
27
|
{
|
|
27
|
-
scope:
|
|
28
|
-
triggerRef:
|
|
29
|
-
contentRef:
|
|
28
|
+
scope: n,
|
|
29
|
+
triggerRef: f,
|
|
30
|
+
contentRef: p,
|
|
30
31
|
contentId: C(),
|
|
31
32
|
titleId: C(),
|
|
32
33
|
descriptionId: C(),
|
|
33
34
|
open: D,
|
|
34
35
|
onOpenChange: R,
|
|
35
|
-
onOpenToggle: c.useCallback(() => R((
|
|
36
|
-
modal:
|
|
36
|
+
onOpenToggle: c.useCallback(() => R((L) => !L), [R]),
|
|
37
|
+
modal: a,
|
|
37
38
|
children: r
|
|
38
39
|
}
|
|
39
40
|
);
|
|
40
41
|
};
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
(o,
|
|
44
|
-
const { __scopeDialog: r, ...
|
|
42
|
+
I.displayName = P;
|
|
43
|
+
const v = "DialogTrigger", J = c.forwardRef(
|
|
44
|
+
(o, n) => {
|
|
45
|
+
const { __scopeDialog: r, ...s } = o, t = l(v, r), e = _(n, t.triggerRef);
|
|
45
46
|
return /* @__PURE__ */ i(
|
|
46
|
-
|
|
47
|
+
d.button,
|
|
47
48
|
{
|
|
48
49
|
type: "button",
|
|
49
50
|
"aria-haspopup": "dialog",
|
|
50
51
|
"aria-expanded": t.open,
|
|
51
52
|
"aria-controls": t.contentId,
|
|
52
|
-
"data-state":
|
|
53
|
-
...
|
|
53
|
+
"data-state": y(t.open),
|
|
54
|
+
...s,
|
|
54
55
|
ref: e,
|
|
55
|
-
onClick:
|
|
56
|
+
onClick: g(o.onClick, t.onOpenToggle)
|
|
56
57
|
}
|
|
57
58
|
);
|
|
58
59
|
}
|
|
59
60
|
);
|
|
60
|
-
|
|
61
|
-
const
|
|
61
|
+
J.displayName = v;
|
|
62
|
+
const h = "DialogPortal", [Q, x] = E(h, {
|
|
62
63
|
forceMount: void 0
|
|
63
|
-
}),
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
}), N = (o) => {
|
|
65
|
+
const { __scopeDialog: n, forceMount: r, children: s, container: t } = o, e = l(h, n);
|
|
66
|
+
return /* @__PURE__ */ i(Q, { scope: n, forceMount: r, children: c.Children.map(s, (a) => /* @__PURE__ */ i(O, { present: r || e.open, children: /* @__PURE__ */ i(V, { asChild: !0, container: t, children: a }) })) });
|
|
67
|
+
};
|
|
68
|
+
N.displayName = h;
|
|
69
|
+
const m = "DialogOverlay", T = c.forwardRef(
|
|
70
|
+
(o, n) => {
|
|
71
|
+
const r = x(m, o.__scopeDialog), { forceMount: s = r.forceMount, ...t } = o, e = l(m, o.__scopeDialog);
|
|
72
|
+
return e.modal ? /* @__PURE__ */ i(O, { present: s || e.open, children: /* @__PURE__ */ i(U, { ...t, ref: n }) }) : null;
|
|
67
73
|
}
|
|
68
74
|
);
|
|
69
|
-
|
|
70
|
-
const
|
|
71
|
-
(o,
|
|
72
|
-
const { __scopeDialog: r, ...
|
|
75
|
+
T.displayName = m;
|
|
76
|
+
const U = c.forwardRef(
|
|
77
|
+
(o, n) => {
|
|
78
|
+
const { __scopeDialog: r, ...s } = o, t = l(m, r);
|
|
73
79
|
return (
|
|
74
80
|
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
75
81
|
// ie. when `Overlay` and `Content` are siblings
|
|
76
|
-
/* @__PURE__ */ i(
|
|
77
|
-
|
|
82
|
+
/* @__PURE__ */ i(Z, { as: z, allowPinchZoom: !0, shards: [t.contentRef], children: /* @__PURE__ */ i(
|
|
83
|
+
d.div,
|
|
78
84
|
{
|
|
79
|
-
"data-state":
|
|
80
|
-
...
|
|
81
|
-
ref:
|
|
82
|
-
style: { pointerEvents: "auto", ...
|
|
85
|
+
"data-state": y(t.open),
|
|
86
|
+
...s,
|
|
87
|
+
ref: n,
|
|
88
|
+
style: { pointerEvents: "auto", ...s.style }
|
|
83
89
|
}
|
|
84
90
|
) })
|
|
85
91
|
);
|
|
86
92
|
}
|
|
87
|
-
),
|
|
88
|
-
(o,
|
|
89
|
-
const r =
|
|
90
|
-
return /* @__PURE__ */ i(
|
|
93
|
+
), u = "DialogContent", M = c.forwardRef(
|
|
94
|
+
(o, n) => {
|
|
95
|
+
const r = x(u, o.__scopeDialog), { forceMount: s = r.forceMount, ...t } = o, e = l(u, o.__scopeDialog);
|
|
96
|
+
return /* @__PURE__ */ i(O, { present: s || e.open, children: e.modal ? /* @__PURE__ */ i(W, { ...t, ref: n }) : /* @__PURE__ */ i(X, { ...t, ref: n }) });
|
|
91
97
|
}
|
|
92
98
|
);
|
|
93
|
-
|
|
94
|
-
const
|
|
95
|
-
(o,
|
|
96
|
-
const r = l(
|
|
99
|
+
M.displayName = u;
|
|
100
|
+
const W = c.forwardRef(
|
|
101
|
+
(o, n) => {
|
|
102
|
+
const r = l(u, o.__scopeDialog), s = c.useRef(null), t = _(n, r.contentRef, s);
|
|
97
103
|
return c.useEffect(() => {
|
|
98
|
-
const e =
|
|
99
|
-
if (e) return
|
|
104
|
+
const e = s.current;
|
|
105
|
+
if (e) return q(e);
|
|
100
106
|
}, []), /* @__PURE__ */ i(
|
|
101
|
-
|
|
107
|
+
b,
|
|
102
108
|
{
|
|
103
109
|
...o,
|
|
104
110
|
ref: t,
|
|
105
111
|
trapFocus: r.open,
|
|
106
112
|
disableOutsidePointerEvents: !0,
|
|
107
|
-
|
|
108
|
-
e.
|
|
109
|
-
|
|
110
|
-
onPointerDownOutside: d(o.onPointerDownOutside, (e) => {
|
|
111
|
-
const u = e.detail.originalEvent, a = u.button === 0 && u.ctrlKey === !0;
|
|
112
|
-
(u.button === 2 || a) && e.preventDefault();
|
|
113
|
+
onPointerDownOutside: g(o.onPointerDownOutside, (e) => {
|
|
114
|
+
const a = e.detail.originalEvent, f = a.button === 0 && a.ctrlKey === !0;
|
|
115
|
+
(a.button === 2 || f) && e.preventDefault();
|
|
113
116
|
}),
|
|
114
|
-
onFocusOutside:
|
|
117
|
+
onFocusOutside: g(
|
|
115
118
|
o.onFocusOutside,
|
|
116
119
|
(e) => e.preventDefault()
|
|
117
120
|
)
|
|
118
121
|
}
|
|
119
122
|
);
|
|
120
123
|
}
|
|
121
|
-
),
|
|
122
|
-
(o,
|
|
123
|
-
const r = l(
|
|
124
|
+
), X = c.forwardRef(
|
|
125
|
+
(o, n) => {
|
|
126
|
+
const r = l(u, o.__scopeDialog), s = c.useRef(!1), t = c.useRef(!1);
|
|
124
127
|
return /* @__PURE__ */ i(
|
|
125
|
-
|
|
128
|
+
b,
|
|
126
129
|
{
|
|
127
130
|
...o,
|
|
128
|
-
ref:
|
|
131
|
+
ref: n,
|
|
129
132
|
trapFocus: !1,
|
|
130
133
|
disableOutsidePointerEvents: !1,
|
|
131
|
-
onCloseAutoFocus: (e) => {
|
|
132
|
-
o.onCloseAutoFocus?.(e), e.defaultPrevented || (n.current || r.triggerRef.current?.focus(), e.preventDefault()), n.current = !1, t.current = !1;
|
|
133
|
-
},
|
|
134
134
|
onInteractOutside: (e) => {
|
|
135
|
-
o.onInteractOutside?.(e), e.defaultPrevented || (
|
|
136
|
-
const
|
|
137
|
-
r.triggerRef.current?.contains(
|
|
135
|
+
o.onInteractOutside?.(e), e.defaultPrevented || (s.current = !0, e.detail.originalEvent.type === "pointerdown" && (t.current = !0));
|
|
136
|
+
const a = e.target;
|
|
137
|
+
r.triggerRef.current?.contains(a) && e.preventDefault(), e.detail.originalEvent.type === "focusin" && t.current && e.preventDefault();
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
);
|
|
141
141
|
}
|
|
142
|
-
),
|
|
143
|
-
(o,
|
|
144
|
-
const { __scopeDialog: r, trapFocus:
|
|
145
|
-
return
|
|
142
|
+
), b = c.forwardRef(
|
|
143
|
+
(o, n) => {
|
|
144
|
+
const { __scopeDialog: r, trapFocus: s, onOpenAutoFocus: t, onCloseAutoFocus: e, ...a } = o, f = l(u, r), p = c.useRef(null), D = _(n, p);
|
|
145
|
+
return Y(), G(() => {
|
|
146
|
+
if (s)
|
|
147
|
+
return K(p.current, {
|
|
148
|
+
preventScroll: !0,
|
|
149
|
+
onActivate: t,
|
|
150
|
+
onDeactivate: e
|
|
151
|
+
});
|
|
152
|
+
}, []), /* @__PURE__ */ i(
|
|
146
153
|
H,
|
|
147
154
|
{
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
role: "dialog",
|
|
157
|
-
id: a.contentId,
|
|
158
|
-
"aria-describedby": a.descriptionId,
|
|
159
|
-
"aria-labelledby": a.titleId,
|
|
160
|
-
"data-state": P(a.open),
|
|
161
|
-
...u,
|
|
162
|
-
ref: D,
|
|
163
|
-
onDismiss: () => a.onOpenChange(!1)
|
|
164
|
-
}
|
|
165
|
-
)
|
|
155
|
+
role: "dialog",
|
|
156
|
+
id: f.contentId,
|
|
157
|
+
"aria-describedby": f.descriptionId,
|
|
158
|
+
"aria-labelledby": f.titleId,
|
|
159
|
+
"data-state": y(f.open),
|
|
160
|
+
...a,
|
|
161
|
+
ref: D,
|
|
162
|
+
onDismiss: () => f.onOpenChange(!1)
|
|
166
163
|
}
|
|
167
|
-
)
|
|
164
|
+
);
|
|
168
165
|
}
|
|
169
|
-
),
|
|
170
|
-
(o,
|
|
171
|
-
const { __scopeDialog: r, ...
|
|
172
|
-
return /* @__PURE__ */ i(
|
|
166
|
+
), w = "DialogTitle", A = c.forwardRef(
|
|
167
|
+
(o, n) => {
|
|
168
|
+
const { __scopeDialog: r, ...s } = o, t = l(w, r);
|
|
169
|
+
return /* @__PURE__ */ i(d.h2, { id: t.titleId, ...s, ref: n });
|
|
173
170
|
}
|
|
174
171
|
);
|
|
175
|
-
|
|
176
|
-
const
|
|
177
|
-
(o,
|
|
178
|
-
const { __scopeDialog: r, ...
|
|
179
|
-
return /* @__PURE__ */ i(
|
|
172
|
+
A.displayName = w;
|
|
173
|
+
const F = "DialogDescription", oo = c.forwardRef(
|
|
174
|
+
(o, n) => {
|
|
175
|
+
const { __scopeDialog: r, ...s } = o, t = l(F, r);
|
|
176
|
+
return /* @__PURE__ */ i(d.p, { id: t.descriptionId, ...s, ref: n });
|
|
180
177
|
}
|
|
181
178
|
);
|
|
182
|
-
|
|
183
|
-
const
|
|
184
|
-
(o,
|
|
185
|
-
const { __scopeDialog: r, ...
|
|
179
|
+
oo.displayName = F;
|
|
180
|
+
const S = "DialogClose", k = c.forwardRef(
|
|
181
|
+
(o, n) => {
|
|
182
|
+
const { __scopeDialog: r, ...s } = o, t = l(S, r);
|
|
186
183
|
return /* @__PURE__ */ i(
|
|
187
|
-
|
|
184
|
+
d.button,
|
|
188
185
|
{
|
|
189
186
|
type: "button",
|
|
190
|
-
...
|
|
191
|
-
ref:
|
|
192
|
-
onClick:
|
|
187
|
+
...s,
|
|
188
|
+
ref: n,
|
|
189
|
+
onClick: g(o.onClick, () => t.onOpenChange(!1))
|
|
193
190
|
}
|
|
194
191
|
);
|
|
195
192
|
}
|
|
196
193
|
);
|
|
197
|
-
|
|
198
|
-
function
|
|
194
|
+
k.displayName = S;
|
|
195
|
+
function y(o) {
|
|
199
196
|
return o ? "open" : "closed";
|
|
200
197
|
}
|
|
201
|
-
const
|
|
198
|
+
const _o = I, Oo = N, Po = T, ho = M, yo = A, Eo = k;
|
|
202
199
|
export {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
200
|
+
Eo as Close,
|
|
201
|
+
ho as Content,
|
|
202
|
+
I as Dialog,
|
|
203
|
+
k as DialogClose,
|
|
204
|
+
M as DialogContent,
|
|
205
|
+
oo as DialogDescription,
|
|
206
|
+
T as DialogOverlay,
|
|
207
|
+
N as DialogPortal,
|
|
208
|
+
A as DialogTitle,
|
|
209
|
+
J as DialogTrigger,
|
|
210
|
+
Po as Overlay,
|
|
211
|
+
Oo as Portal,
|
|
212
|
+
_o as Root,
|
|
213
|
+
yo as Title,
|
|
214
|
+
Co as createDialogScope
|
|
216
215
|
};
|
package/dist/index.d.cts
CHANGED
|
@@ -22,7 +22,6 @@ import { FeebackReason } from '@inkeep/cxkit-types';
|
|
|
22
22
|
import { FeedbackItemType } from '@inkeep/cxkit-types';
|
|
23
23
|
import { FeedbackType } from '@inkeep/cxkit-types';
|
|
24
24
|
import { FieldErrors } from 'react-hook-form';
|
|
25
|
-
import { FocusScope } from '@radix-ui/react-focus-scope';
|
|
26
25
|
import { FormField } from '@inkeep/cxkit-types';
|
|
27
26
|
import { FormHTMLAttributes } from 'react';
|
|
28
27
|
import { ForwardRefExoticComponent } from 'react';
|
|
@@ -54,7 +53,6 @@ import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
|
54
53
|
import { Portal as Portal_2 } from '@radix-ui/react-portal';
|
|
55
54
|
import { Primitive } from '@radix-ui/react-primitive';
|
|
56
55
|
import { PropsWithChildren } from 'react';
|
|
57
|
-
import * as RadixDialog from '@radix-ui/react-dialog';
|
|
58
56
|
import * as React_2 from 'react';
|
|
59
57
|
import { ReactElement } from 'react';
|
|
60
58
|
import { ReactNode } from 'react';
|
|
@@ -74,6 +72,7 @@ import { ToolCallAction } from '@inkeep/cxkit-types';
|
|
|
74
72
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
75
73
|
import { TopLevelHeading } from '@inkeep/cxkit-types';
|
|
76
74
|
import { TransformedSource } from '@inkeep/cxkit-types';
|
|
75
|
+
import { TrapFocusOptions } from '@zag-js/focus-trap';
|
|
77
76
|
import { UrlQueryParam } from '@inkeep/cxkit-types';
|
|
78
77
|
import { UserProperties as UserProperties_2 } from '@inkeep/cxkit-types';
|
|
79
78
|
import { Workflow } from '@inkeep/cxkit-types';
|
|
@@ -548,7 +547,7 @@ export declare const Command: React_2.ForwardRefExoticComponent<Children & Omit<
|
|
|
548
547
|
/** Whether this separator should always be rendered. Useful if you disable automatic filtering. */
|
|
549
548
|
alwaysRender?: boolean;
|
|
550
549
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
551
|
-
Dialog: React_2.ForwardRefExoticComponent<
|
|
550
|
+
Dialog: React_2.ForwardRefExoticComponent<DialogPrimitive.DialogProps & Children & Omit<React_2.ClassAttributes<HTMLDivElement> & React_2.HTMLAttributes<HTMLDivElement> & {
|
|
552
551
|
asChild?: boolean;
|
|
553
552
|
}, "ref"> & {
|
|
554
553
|
/**
|
|
@@ -620,7 +619,7 @@ export declare const Command: React_2.ForwardRefExoticComponent<Children & Omit<
|
|
|
620
619
|
/**
|
|
621
620
|
* Renders the command menu in a Radix Dialog.
|
|
622
621
|
*/
|
|
623
|
-
export declare const CommandDialog: React_2.ForwardRefExoticComponent<
|
|
622
|
+
export declare const CommandDialog: React_2.ForwardRefExoticComponent<DialogPrimitive.DialogProps & Children & Omit<React_2.ClassAttributes<HTMLDivElement> & React_2.HTMLAttributes<HTMLDivElement> & {
|
|
624
623
|
asChild?: boolean;
|
|
625
624
|
}, "ref"> & {
|
|
626
625
|
/**
|
|
@@ -1443,17 +1442,17 @@ declare interface DialogContentImplProps extends Omit<DismissableLayerProps, 'on
|
|
|
1443
1442
|
* pointer, or a programmatic focus.
|
|
1444
1443
|
* @defaultValue false
|
|
1445
1444
|
*/
|
|
1446
|
-
trapFocus?:
|
|
1445
|
+
trapFocus?: boolean;
|
|
1447
1446
|
/**
|
|
1448
1447
|
* Event handler called when auto-focusing on open.
|
|
1449
1448
|
* Can be prevented.
|
|
1450
1449
|
*/
|
|
1451
|
-
onOpenAutoFocus?:
|
|
1450
|
+
onOpenAutoFocus?: TrapFocusOptions['onActivate'];
|
|
1452
1451
|
/**
|
|
1453
1452
|
* Event handler called when auto-focusing on close.
|
|
1454
1453
|
* Can be prevented.
|
|
1455
1454
|
*/
|
|
1456
|
-
onCloseAutoFocus?:
|
|
1455
|
+
onCloseAutoFocus?: TrapFocusOptions['onDeactivate'];
|
|
1457
1456
|
}
|
|
1458
1457
|
|
|
1459
1458
|
declare interface DialogContentProps extends DialogContentTypeProps {
|
|
@@ -2717,8 +2716,6 @@ export declare const FeedbackProvider: React.FC<{
|
|
|
2717
2716
|
children: React.ReactNode;
|
|
2718
2717
|
}>;
|
|
2719
2718
|
|
|
2720
|
-
declare type FocusScopeProps = React_2.ComponentPropsWithoutRef<typeof FocusScope>;
|
|
2721
|
-
|
|
2722
2719
|
declare type FormErrors = Record<'title' | 'content', string | undefined>;
|
|
2723
2720
|
|
|
2724
2721
|
export declare interface FormFieldContextValue extends FormFieldCtx {
|
package/dist/index.d.ts
CHANGED
|
@@ -22,7 +22,6 @@ import { FeebackReason } from '@inkeep/cxkit-types';
|
|
|
22
22
|
import { FeedbackItemType } from '@inkeep/cxkit-types';
|
|
23
23
|
import { FeedbackType } from '@inkeep/cxkit-types';
|
|
24
24
|
import { FieldErrors } from 'react-hook-form';
|
|
25
|
-
import { FocusScope } from '@radix-ui/react-focus-scope';
|
|
26
25
|
import { FormField } from '@inkeep/cxkit-types';
|
|
27
26
|
import { FormHTMLAttributes } from 'react';
|
|
28
27
|
import { ForwardRefExoticComponent } from 'react';
|
|
@@ -54,7 +53,6 @@ import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
|
54
53
|
import { Portal as Portal_2 } from '@radix-ui/react-portal';
|
|
55
54
|
import { Primitive } from '@radix-ui/react-primitive';
|
|
56
55
|
import { PropsWithChildren } from 'react';
|
|
57
|
-
import * as RadixDialog from '@radix-ui/react-dialog';
|
|
58
56
|
import * as React_2 from 'react';
|
|
59
57
|
import { ReactElement } from 'react';
|
|
60
58
|
import { ReactNode } from 'react';
|
|
@@ -74,6 +72,7 @@ import { ToolCallAction } from '@inkeep/cxkit-types';
|
|
|
74
72
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
75
73
|
import { TopLevelHeading } from '@inkeep/cxkit-types';
|
|
76
74
|
import { TransformedSource } from '@inkeep/cxkit-types';
|
|
75
|
+
import { TrapFocusOptions } from '@zag-js/focus-trap';
|
|
77
76
|
import { UrlQueryParam } from '@inkeep/cxkit-types';
|
|
78
77
|
import { UserProperties as UserProperties_2 } from '@inkeep/cxkit-types';
|
|
79
78
|
import { Workflow } from '@inkeep/cxkit-types';
|
|
@@ -548,7 +547,7 @@ export declare const Command: React_2.ForwardRefExoticComponent<Children & Omit<
|
|
|
548
547
|
/** Whether this separator should always be rendered. Useful if you disable automatic filtering. */
|
|
549
548
|
alwaysRender?: boolean;
|
|
550
549
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
551
|
-
Dialog: React_2.ForwardRefExoticComponent<
|
|
550
|
+
Dialog: React_2.ForwardRefExoticComponent<DialogPrimitive.DialogProps & Children & Omit<React_2.ClassAttributes<HTMLDivElement> & React_2.HTMLAttributes<HTMLDivElement> & {
|
|
552
551
|
asChild?: boolean;
|
|
553
552
|
}, "ref"> & {
|
|
554
553
|
/**
|
|
@@ -620,7 +619,7 @@ export declare const Command: React_2.ForwardRefExoticComponent<Children & Omit<
|
|
|
620
619
|
/**
|
|
621
620
|
* Renders the command menu in a Radix Dialog.
|
|
622
621
|
*/
|
|
623
|
-
export declare const CommandDialog: React_2.ForwardRefExoticComponent<
|
|
622
|
+
export declare const CommandDialog: React_2.ForwardRefExoticComponent<DialogPrimitive.DialogProps & Children & Omit<React_2.ClassAttributes<HTMLDivElement> & React_2.HTMLAttributes<HTMLDivElement> & {
|
|
624
623
|
asChild?: boolean;
|
|
625
624
|
}, "ref"> & {
|
|
626
625
|
/**
|
|
@@ -1443,17 +1442,17 @@ declare interface DialogContentImplProps extends Omit<DismissableLayerProps, 'on
|
|
|
1443
1442
|
* pointer, or a programmatic focus.
|
|
1444
1443
|
* @defaultValue false
|
|
1445
1444
|
*/
|
|
1446
|
-
trapFocus?:
|
|
1445
|
+
trapFocus?: boolean;
|
|
1447
1446
|
/**
|
|
1448
1447
|
* Event handler called when auto-focusing on open.
|
|
1449
1448
|
* Can be prevented.
|
|
1450
1449
|
*/
|
|
1451
|
-
onOpenAutoFocus?:
|
|
1450
|
+
onOpenAutoFocus?: TrapFocusOptions['onActivate'];
|
|
1452
1451
|
/**
|
|
1453
1452
|
* Event handler called when auto-focusing on close.
|
|
1454
1453
|
* Can be prevented.
|
|
1455
1454
|
*/
|
|
1456
|
-
onCloseAutoFocus?:
|
|
1455
|
+
onCloseAutoFocus?: TrapFocusOptions['onDeactivate'];
|
|
1457
1456
|
}
|
|
1458
1457
|
|
|
1459
1458
|
declare interface DialogContentProps extends DialogContentTypeProps {
|
|
@@ -2717,8 +2716,6 @@ export declare const FeedbackProvider: React.FC<{
|
|
|
2717
2716
|
children: React.ReactNode;
|
|
2718
2717
|
}>;
|
|
2719
2718
|
|
|
2720
|
-
declare type FocusScopeProps = React_2.ComponentPropsWithoutRef<typeof FocusScope>;
|
|
2721
|
-
|
|
2722
2719
|
declare type FormErrors = Record<'title' | 'content', string | undefined>;
|
|
2723
2720
|
|
|
2724
2721
|
export declare interface FormFieldContextValue extends FormFieldCtx {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("react/jsx-runtime"),t=require("react"),y=require("../atoms/api/analytics/events.cjs"),B=require("./config-provider.cjs"),f=require("./user-provider.cjs"),d=t.createContext(void 0),b=({children:e})=>{const{baseSettings:n,componentType:o}=B.useInkeepConfig(),{apiKey:r,analyticsApiBaseUrl:i,tags:c,privacyPreferences:E,env:g}=n,{userProperties:a}=f.useUser(),v=t.useMemo(()=>({widgetLibraryVersion:"0.5.
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("react/jsx-runtime"),t=require("react"),y=require("../atoms/api/analytics/events.cjs"),B=require("./config-provider.cjs"),f=require("./user-provider.cjs"),d=t.createContext(void 0),b=({children:e})=>{const{baseSettings:n,componentType:o}=B.useInkeepConfig(),{apiKey:r,analyticsApiBaseUrl:i,tags:c,privacyPreferences:E,env:g}=n,{userProperties:a}=f.useUser(),v=t.useMemo(()=>({widgetLibraryVersion:"0.5.49",componentType:o,tags:c}),[o,c]),u=!E.optOutAllAnalytics&&g!=="development",m={logEvent:t.useCallback(async l=>{const s={...v,...l.properties},p={eventName:l.eventName,properties:s,userProperties:a};if(u){if("conversation"in s&&!s.conversation?.id)return;y.logEvent(p,r,i)}n.onEvent?.(p)},[u,n,r,i,a,v])};return P.jsx(d.Provider,{value:m,children:e})},x=()=>{const e=t.useContext(d);if(!e)throw new Error("useBaseEvents must be used within a BaseEventsProvider");return e};exports.BaseEventsProvider=b;exports.useBaseEvents=x;
|
|
@@ -7,7 +7,7 @@ import { useUser as b } from "./user-provider.js";
|
|
|
7
7
|
const u = x(void 0), U = ({ children: e }) => {
|
|
8
8
|
const { baseSettings: t, componentType: n } = C(), { apiKey: s, analyticsApiBaseUrl: r, tags: i, privacyPreferences: l, env: E } = t, { userProperties: a } = b(), c = g(
|
|
9
9
|
() => ({
|
|
10
|
-
widgetLibraryVersion: "0.5.
|
|
10
|
+
widgetLibraryVersion: "0.5.49",
|
|
11
11
|
componentType: n,
|
|
12
12
|
tags: i
|
|
13
13
|
}),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/cxkit-primitives",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.49",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Inkeep, Inc. Customer License (IICL) v1.1",
|
|
6
6
|
"homepage": "",
|
|
@@ -25,25 +25,25 @@
|
|
|
25
25
|
"@radix-ui/react-checkbox": "1.1.3",
|
|
26
26
|
"@radix-ui/react-compose-refs": "^1.1.1",
|
|
27
27
|
"@radix-ui/react-context": "^1.1.1",
|
|
28
|
-
"@radix-ui/react-dialog": "1.1.4",
|
|
29
28
|
"@radix-ui/react-dismissable-layer": "^1.1.5",
|
|
30
29
|
"@radix-ui/react-focus-guards": "^1.1.1",
|
|
31
30
|
"@radix-ui/react-focus-scope": "^1.1.2",
|
|
32
31
|
"@radix-ui/react-hover-card": "^1.1.6",
|
|
33
32
|
"@radix-ui/react-id": "^1.1.0",
|
|
34
|
-
"@radix-ui/react-popover": "1.1.
|
|
33
|
+
"@radix-ui/react-popover": "1.1.6",
|
|
35
34
|
"@radix-ui/react-portal": "^1.1.4",
|
|
36
35
|
"@radix-ui/react-presence": "^1.1.2",
|
|
37
36
|
"@radix-ui/react-primitive": "^2.0.2",
|
|
38
37
|
"@radix-ui/react-scroll-area": "1.2.2",
|
|
39
|
-
"@radix-ui/react-select": "2.1.
|
|
38
|
+
"@radix-ui/react-select": "2.1.6",
|
|
40
39
|
"@radix-ui/react-slot": "^1.1.2",
|
|
41
40
|
"@radix-ui/react-tabs": "1.1.2",
|
|
42
41
|
"@radix-ui/react-tooltip": "1.1.6",
|
|
42
|
+
"@radix-ui/react-use-callback-ref": "^1.1.0",
|
|
43
43
|
"@radix-ui/react-use-controllable-state": "^1.1.0",
|
|
44
|
+
"@zag-js/focus-trap": "^1.7.0",
|
|
44
45
|
"altcha-lib": "^1.2.0",
|
|
45
46
|
"aria-hidden": "^1.2.4",
|
|
46
|
-
"cmdk": "^1.0.4",
|
|
47
47
|
"dequal": "^2.0.3",
|
|
48
48
|
"humps": "2.0.1",
|
|
49
49
|
"merge-anything": "5.1.7",
|
|
@@ -59,9 +59,9 @@
|
|
|
59
59
|
"remark-gfm": "^4.0.1",
|
|
60
60
|
"unist-util-visit": "^5.0.0",
|
|
61
61
|
"use-sync-external-store": "^1.4.0",
|
|
62
|
-
"@inkeep/cxkit-color-mode": "0.5.
|
|
63
|
-
"@inkeep/cxkit-theme": "0.5.
|
|
64
|
-
"@inkeep/cxkit-types": "0.5.
|
|
62
|
+
"@inkeep/cxkit-color-mode": "0.5.49",
|
|
63
|
+
"@inkeep/cxkit-theme": "0.5.49",
|
|
64
|
+
"@inkeep/cxkit-types": "0.5.49"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@biomejs/biome": "1.9.4",
|