neatkit 0.4.2 → 0.6.0
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/Alert-DQ5CCE0N.js +29 -0
- package/dist/Alert-LJDkNUqH.cjs +1 -0
- package/dist/Alert.cjs +1 -0
- package/dist/Alert.js +4 -0
- package/dist/Avatar.cjs +1 -0
- package/dist/Avatar.js +55 -0
- package/dist/Badge.cjs +1 -0
- package/dist/Badge.js +25 -0
- package/dist/Button-BAsLfA0D.js +99 -0
- package/dist/Button-D7JUO6Fs.cjs +1 -0
- package/dist/Button.cjs +1 -0
- package/dist/Button.js +5 -0
- package/dist/Card-CPq6dsut.js +34 -0
- package/dist/Card-CQ-8_1tO.cjs +1 -0
- package/dist/Card.cjs +1 -0
- package/dist/Card.js +4 -0
- package/dist/Checkbox-BvXM9VyY.js +68 -0
- package/dist/Checkbox-VQifZrZZ.cjs +1 -0
- package/dist/Checkbox.cjs +1 -0
- package/dist/Checkbox.js +5 -0
- package/dist/CheckboxGroup.cjs +1 -0
- package/dist/CheckboxGroup.js +144 -0
- package/dist/Code-BP2ZCmUf.js +7446 -0
- package/dist/Code-eispVOW3.cjs +6 -0
- package/dist/Code.cjs +1 -0
- package/dist/Code.js +5 -0
- package/dist/Content.cjs +1 -0
- package/dist/Content.js +144 -0
- package/dist/Divider-BE15WVDI.js +42 -0
- package/dist/Divider-CJYbFcSX.cjs +1 -0
- package/dist/Divider.cjs +1 -0
- package/dist/Divider.js +4 -0
- package/dist/Field.cjs +1 -0
- package/dist/Field.js +115 -0
- package/dist/Icon-D8IZceys.cjs +1 -0
- package/dist/Icon-uQmpr5P2.js +1139 -0
- package/dist/Icon.cjs +1 -0
- package/dist/Icon.js +37 -0
- package/dist/Input.cjs +1 -0
- package/dist/Input.js +146 -0
- package/dist/Markdown.cjs +31 -0
- package/dist/Markdown.js +18411 -0
- package/dist/Modal.cjs +1 -0
- package/dist/Modal.js +171 -0
- package/dist/PinInput.cjs +1 -0
- package/dist/PinInput.js +248 -0
- package/dist/Popover.cjs +1 -0
- package/dist/Popover.js +238 -0
- package/dist/Radio.cjs +1 -0
- package/dist/Radio.js +65 -0
- package/dist/RadioGroup.cjs +1 -0
- package/dist/RadioGroup.js +51 -0
- package/dist/RadioGroupContext-BX9KnDek.cjs +1 -0
- package/dist/RadioGroupContext-DbKM4zPZ.js +5 -0
- package/dist/Select.cjs +1 -0
- package/dist/Select.js +473 -0
- package/dist/Skeleton.cjs +1 -0
- package/dist/Skeleton.js +27 -0
- package/dist/Spinner-BXgw60UC.cjs +1 -0
- package/dist/Spinner-CVYvk6YK.js +25 -0
- package/dist/Spinner.cjs +1 -0
- package/dist/Spinner.js +4 -0
- package/dist/Surface-BttJYSDt.cjs +1 -0
- package/dist/Surface-vEFsZC12.js +17 -0
- package/dist/Switch.cjs +1 -0
- package/dist/Switch.js +39 -0
- package/dist/Table-83unQQOi.cjs +1 -0
- package/dist/Table-Cw8u-pEW.js +403 -0
- package/dist/Table.cjs +1 -0
- package/dist/Table.js +5 -0
- package/dist/Text-DWYlIcPj.cjs +1 -0
- package/dist/Text-rN6iDo0V.js +24 -0
- package/dist/Text.cjs +1 -0
- package/dist/Text.js +4 -0
- package/dist/TextArea.cjs +1 -0
- package/dist/TextArea.js +43 -0
- package/dist/Tooltip-BB82wNOE.cjs +1 -0
- package/dist/Tooltip-CqWK_GRD.js +236 -0
- package/dist/Tooltip.cjs +1 -0
- package/dist/Tooltip.js +6 -0
- package/dist/aria-DHnOMyYp.js +10 -0
- package/dist/aria-DKxpE8cA.cjs +1 -0
- package/dist/components/Alert/index.d.ts +1 -1
- package/dist/components/Avatar/index.d.ts +1 -1
- package/dist/components/Badge/index.d.ts +1 -1
- package/dist/components/Button/Button.d.ts +2 -2
- package/dist/components/Button/index.d.ts +1 -1
- package/dist/components/Card/index.d.ts +1 -1
- package/dist/components/Checkbox/index.d.ts +1 -1
- package/dist/components/CheckboxGroup/index.d.ts +1 -1
- package/dist/components/Code/Code.d.ts +47 -0
- package/dist/components/Code/index.d.ts +2 -0
- package/dist/components/Code/utils/highlight.d.ts +17 -0
- package/dist/components/Content/Content.d.ts +3 -3
- package/dist/components/Content/index.d.ts +2 -2
- package/dist/components/Divider/index.d.ts +1 -1
- package/dist/components/Field/index.d.ts +1 -1
- package/dist/components/Icon/index.d.ts +1 -1
- package/dist/components/Input/index.d.ts +1 -1
- package/dist/components/Markdown/Markdown.d.ts +66 -0
- package/dist/components/Markdown/index.d.ts +3 -0
- package/dist/components/Markdown/utils/language.d.ts +9 -0
- package/dist/components/Markdown/utils/renderers.d.ts +15 -0
- package/dist/components/Markdown/utils/security.d.ts +66 -0
- package/dist/components/Modal/index.d.ts +1 -1
- package/dist/components/PinInput/index.d.ts +1 -1
- package/dist/components/Popover/index.d.ts +1 -1
- package/dist/components/Radio/index.d.ts +1 -1
- package/dist/components/RadioGroup/index.d.ts +1 -1
- package/dist/components/Select/index.d.ts +1 -1
- package/dist/components/Skeleton/index.d.ts +1 -1
- package/dist/components/Spinner/index.d.ts +1 -1
- package/dist/components/Switch/index.d.ts +1 -1
- package/dist/components/Table/Table.d.ts +7 -11
- package/dist/components/Table/index.d.ts +1 -1
- package/dist/components/Text/index.d.ts +1 -1
- package/dist/components/TextArea/index.d.ts +1 -1
- package/dist/components/Tooltip/index.d.ts +1 -1
- package/dist/field-control-NfLwcPj6.cjs +1 -0
- package/dist/field-control-XAn_FKks.js +16 -0
- package/dist/focus-restoration-70WcQRr5.cjs +1 -0
- package/dist/focus-restoration-BvNZzrQA.js +16 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -26
- package/dist/index.js +6 -4409
- package/dist/reference-C2guRuR0.cjs +1 -0
- package/dist/reference-CXMr27nM.js +12 -0
- package/dist/style.css +1 -1
- package/dist/tokens.d.ts +1 -1
- package/dist/units-BmjPCccF.js +90 -0
- package/dist/units-PzuiQNnw.cjs +1 -0
- package/dist/useFloatingPosition-CxzhAvy8.js +73 -0
- package/dist/useFloatingPosition-D1FqYy0l.cjs +1 -0
- package/dist/useFocusTrap--cgjy78G.cjs +1 -0
- package/dist/useFocusTrap-Da4nEash.js +134 -0
- package/dist/usePresence-DSPt6aKi.js +210 -0
- package/dist/usePresence-qe92UTvK.cjs +1 -0
- package/package.json +155 -2
package/dist/Spinner.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Spinner-BXgw60UC.cjs");exports.default=e.Spinner;
|
package/dist/Spinner.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),a=require("react"),o=a.forwardRef(function(e,r){const{children:c,className:s,...n}=e;return t.jsx("div",{...n,ref:r,className:["nk-surface",s].filter(Boolean).join(" "),children:c})});exports.Surface=o;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as s } from "react";
|
|
3
|
+
const m = s(function(r, e) {
|
|
4
|
+
const { children: o, className: a, ...f } = r;
|
|
5
|
+
return /* @__PURE__ */ n(
|
|
6
|
+
"div",
|
|
7
|
+
{
|
|
8
|
+
...f,
|
|
9
|
+
ref: e,
|
|
10
|
+
className: ["nk-surface", a].filter(Boolean).join(" "),
|
|
11
|
+
children: o
|
|
12
|
+
}
|
|
13
|
+
);
|
|
14
|
+
});
|
|
15
|
+
export {
|
|
16
|
+
m as S
|
|
17
|
+
};
|
package/dist/Switch.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),l=require("react"),d=require("./aria-DKxpE8cA.cjs"),o=l.forwardRef(function(s,t){const{"aria-invalid":e,className:n,disabled:i=!1,style:r,...c}=s;return a.jsxs("span",{className:["nk-switch",n].filter(Boolean).join(" "),"data-disabled":i||void 0,"data-invalid":d.hasInvalidState(e)||void 0,style:r,children:[a.jsx("input",{...c,ref:t,"aria-invalid":e,className:"nk-switch__control",disabled:i,role:"switch",type:"checkbox"}),a.jsx("span",{"aria-hidden":"true",className:"nk-switch__track",children:a.jsx("span",{className:"nk-switch__thumb"})})]})});exports.default=o;
|
package/dist/Switch.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsxs as l, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as o } from "react";
|
|
3
|
+
import { h as d } from "./aria-DHnOMyYp.js";
|
|
4
|
+
const w = o(function(t, n) {
|
|
5
|
+
const {
|
|
6
|
+
"aria-invalid": i,
|
|
7
|
+
className: e,
|
|
8
|
+
disabled: s = !1,
|
|
9
|
+
style: r,
|
|
10
|
+
...c
|
|
11
|
+
} = t;
|
|
12
|
+
return /* @__PURE__ */ l(
|
|
13
|
+
"span",
|
|
14
|
+
{
|
|
15
|
+
className: ["nk-switch", e].filter(Boolean).join(" "),
|
|
16
|
+
"data-disabled": s || void 0,
|
|
17
|
+
"data-invalid": d(i) || void 0,
|
|
18
|
+
style: r,
|
|
19
|
+
children: [
|
|
20
|
+
/* @__PURE__ */ a(
|
|
21
|
+
"input",
|
|
22
|
+
{
|
|
23
|
+
...c,
|
|
24
|
+
ref: n,
|
|
25
|
+
"aria-invalid": i,
|
|
26
|
+
className: "nk-switch__control",
|
|
27
|
+
disabled: s,
|
|
28
|
+
role: "switch",
|
|
29
|
+
type: "checkbox"
|
|
30
|
+
}
|
|
31
|
+
),
|
|
32
|
+
/* @__PURE__ */ a("span", { "aria-hidden": "true", className: "nk-switch__track", children: /* @__PURE__ */ a("span", { className: "nk-switch__thumb" }) })
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
});
|
|
37
|
+
export {
|
|
38
|
+
w as default
|
|
39
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";const c=require("react/jsx-runtime"),o=require("react"),P=require("./reference-C2guRuR0.cjs"),A=require("./Button-D7JUO6Fs.cjs"),B=require("./Tooltip-BB82wNOE.cjs"),L=["a[href]","audio[controls]","button","iframe","input","label","select","summary","textarea","video[controls]","[contenteditable]:not([contenteditable='false'])"].join(","),I=new Set(["button","checkbox","combobox","grid","link","listbox","menu","menubar","menuitem","menuitemcheckbox","menuitemradio","option","radio","radiogroup","scrollbar","searchbox","slider","spinbutton","switch","tab","tablist","textbox","tree","treegrid","treeitem"]);function D(r,n){var t;let e=r;for(;e&&e!==n;){if(e.matches(L)||(((t=e.getAttribute("role"))==null?void 0:t.split(/\s+/))??[]).some(l=>I.has(l)))return!0;e=e.parentElement}return!1}function H(r,n,e){return r===void 0?n:e?e(r):r instanceof Date?Number.isNaN(r.getTime())?"Invalid Date":r.toISOString().slice(0,10):typeof r=="boolean"?r?"Yes":"No":r}function O(r){if(typeof r=="number"||typeof r=="string")return String(r)}function w(r){for(const n of o.Children.toArray(r)){if(o.isValidElement(n)&&n.type===o.Fragment){if(w(n.props.children))return!0;continue}return!0}return!1}function K(r,n){let e=!1;function t(l){return o.Children.map(l,i=>o.isValidElement(i)?i.type===o.Fragment?o.cloneElement(i,void 0,t(i.props.children)):!e&&i.type===S?(e=!0,o.cloneElement(i,{rowTrigger:n})):i:i)}const a=t(r);return{attached:e,content:a}}const F=o.forwardRef(function(n,e){const{children:t,className:a,...l}=n;return c.jsx("thead",{...l,ref:e,className:["nk-table__head",a].filter(Boolean).join(" "),children:t})}),V=o.forwardRef(function(n,e){const{children:t,className:a,emptyColumnCount:l=1,emptyMessage:i,...u}=n,f=!w(t),h=Number.isFinite(l)?Math.max(1,Math.floor(l)):1;return c.jsx("tbody",{...u,ref:e,className:["nk-table__body",a].filter(Boolean).join(" "),children:f&&i!==void 0?c.jsx("tr",{className:"nk-table__row",children:c.jsx("td",{className:"nk-table__cell nk-table__empty-cell",colSpan:h,children:c.jsx("div",{className:"nk-table__empty-content",children:i})})}):t})}),q=o.forwardRef(function(n,e){const{children:t,className:a,...l}=n;return c.jsx("tfoot",{...l,ref:e,className:["nk-table__foot",a].filter(Boolean).join(" "),children:t})}),z=o.forwardRef(function(n,e){const{"aria-label":t,children:a,className:l,download:i,href:u,hrefLang:f,onClick:h,onNavigate:k,rel:s,target:R,...g}=n,C=o.useRef(null),_=u!==void 0||h!==void 0,j=(t==null?void 0:t.trim())||(u!==void 0?"Open row":"Activate row");function p(d){C.current=d}const y=u!==void 0?{ariaLabel:j,kind:"link",linkProperties:{download:i,href:u,hrefLang:f,onNavigate:k,rel:s,target:R},reference:p}:h!==void 0?{ariaLabel:j,kind:"button",onClick:h,reference:p}:void 0,N=y?K(a,y):{content:a};function v(d){if(d.defaultPrevented)return;const b=d.target;if(!(b instanceof Element)||D(b,d.currentTarget))return;const T=C.current;if(!T)return;const m=T.ownerDocument.defaultView;if(!m){T.click();return}T.dispatchEvent(new m.MouseEvent("click",{altKey:d.altKey,bubbles:!0,button:d.button,buttons:d.buttons,cancelable:!0,clientX:d.clientX,clientY:d.clientY,ctrlKey:d.ctrlKey,metaKey:d.metaKey,shiftKey:d.shiftKey}))}return c.jsx("tr",{...g,ref:e,"aria-label":_?void 0:t,className:["nk-table__row",l].filter(Boolean).join(" "),"data-interactive":_||void 0,onClick:_?v:void 0,children:N.content})}),E=o.forwardRef(function(n,e){const{align:t="left",children:a,className:l,scope:i="col",sticky:u=!1,...f}=n;return c.jsx("th",{...f,ref:e,className:["nk-table__header-cell",l].filter(Boolean).join(" "),"data-align":t,"data-sticky":u||void 0,scope:i,children:a})}),M=o.forwardRef(function(n,e){const{children:t,className:a,...l}=n;return c.jsx(E,{...l,ref:e,align:"right",className:["nk-table__action-header-cell",a].filter(Boolean).join(" "),children:t??c.jsx("span",{className:"nk-table__visually-hidden",children:"Row actions"})})}),S=o.forwardRef(function(n,e){const{align:t="left",children:a,className:l,format:i,title:u,truncate:f,value:h,...k}=n,{rowTrigger:s,...R}=k,g=H(h,a,i),C=f===void 0?void 0:{maxWidth:f},_=u??(f===void 0?void 0:O(g));return c.jsxs("td",{...R,ref:e,className:["nk-table__cell",l].filter(Boolean).join(" "),"data-align":t,title:_,children:[(s==null?void 0:s.kind)==="link"&&s.linkProperties?c.jsx("a",{ref:s.reference,"aria-label":s.ariaLabel,className:"nk-table__row-trigger",download:s.linkProperties.download,href:s.linkProperties.href,hrefLang:s.linkProperties.hrefLang,onClick:s.linkProperties.onNavigate,rel:s.linkProperties.rel,target:s.linkProperties.target}):null,(s==null?void 0:s.kind)==="button"?c.jsx("button",{ref:s.reference,"aria-label":s.ariaLabel,className:"nk-table__row-trigger",onClick:s.onClick,type:"button"}):null,f!==void 0?c.jsx("span",{className:"nk-table__truncated-content",style:C,children:g}):g]})}),Y=o.forwardRef(function(n,e){const{"aria-label":t,icon:a,label:l,...i}=n;return c.jsx(B.Tooltip,{content:l,children:c.jsx(A.Button,{...i,ref:e,"aria-label":t??l,className:"nk-table__action",icon:a,shape:"rectangle",type:"button",variant:"ghost"})})}),X=o.forwardRef(function(n,e){const{children:t,className:a,onClick:l,...i}=n;function u(f){f.stopPropagation(),l==null||l(f)}return c.jsx("td",{...i,ref:e,className:["nk-table__cell","nk-table__action-cell",a].filter(Boolean).join(" "),"data-align":"right",onClick:u,children:c.jsx("span",{className:"nk-table__action-list",children:t})})}),W=o.forwardRef(function(n,e){const{"aria-label":t,children:a,className:l,containerClassName:i,...u}=n,f=o.useRef(null),h=o.useRef(null),[k,s]=o.useState(!1),[R,g]=o.useState(!1),C=t?`${t} scroll area`:"Scrollable table",_=o.useCallback(p=>{h.current=p,P.assignElementReference(e,p)},[e]);o.useEffect(()=>{const p=f.current,y=h.current;if(!p||!y)return;const N=p,v=y;function d(){const x=N.scrollWidth>N.clientWidth;s(x),x||g(!1)}d();const b=N.ownerDocument.defaultView;b==null||b.addEventListener("resize",d);const T=b==null?void 0:b.ResizeObserver,m=T?new T(d):void 0;return m==null||m.observe(N),m==null||m.observe(v),()=>{b==null||b.removeEventListener("resize",d),m==null||m.disconnect()}},[]);function j(p){g(k&&p.currentTarget.scrollLeft>1)}return c.jsx("div",{ref:f,"aria-label":k?C:void 0,className:["nk-table__container",i].filter(Boolean).join(" "),"data-scrolled":R||void 0,onScroll:j,role:k?"region":void 0,tabIndex:k?0:void 0,children:c.jsx("table",{...u,ref:_,"aria-label":t,className:["nk-table",l].filter(Boolean).join(" "),children:a})})}),$=Object.assign(W,{Action:Y,ActionCell:X,ActionHeaderCell:M,Body:V,Cell:S,Foot:q,HeaderCell:E,Head:F,Row:z});exports.Table=$;
|
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as c, jsxs as H } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as h, useRef as P, useState as w, useCallback as O, useEffect as K, Children as B, isValidElement as x, Fragment as L, cloneElement as A } from "react";
|
|
4
|
+
import { a as F } from "./reference-CXMr27nM.js";
|
|
5
|
+
import { B as V } from "./Button-BAsLfA0D.js";
|
|
6
|
+
import { a as z } from "./Tooltip-CqWK_GRD.js";
|
|
7
|
+
const M = [
|
|
8
|
+
"a[href]",
|
|
9
|
+
"audio[controls]",
|
|
10
|
+
"button",
|
|
11
|
+
"iframe",
|
|
12
|
+
"input",
|
|
13
|
+
"label",
|
|
14
|
+
"select",
|
|
15
|
+
"summary",
|
|
16
|
+
"textarea",
|
|
17
|
+
"video[controls]",
|
|
18
|
+
"[contenteditable]:not([contenteditable='false'])"
|
|
19
|
+
].join(","), Y = /* @__PURE__ */ new Set([
|
|
20
|
+
"button",
|
|
21
|
+
"checkbox",
|
|
22
|
+
"combobox",
|
|
23
|
+
"grid",
|
|
24
|
+
"link",
|
|
25
|
+
"listbox",
|
|
26
|
+
"menu",
|
|
27
|
+
"menubar",
|
|
28
|
+
"menuitem",
|
|
29
|
+
"menuitemcheckbox",
|
|
30
|
+
"menuitemradio",
|
|
31
|
+
"option",
|
|
32
|
+
"radio",
|
|
33
|
+
"radiogroup",
|
|
34
|
+
"scrollbar",
|
|
35
|
+
"searchbox",
|
|
36
|
+
"slider",
|
|
37
|
+
"spinbutton",
|
|
38
|
+
"switch",
|
|
39
|
+
"tab",
|
|
40
|
+
"tablist",
|
|
41
|
+
"textbox",
|
|
42
|
+
"tree",
|
|
43
|
+
"treegrid",
|
|
44
|
+
"treeitem"
|
|
45
|
+
]);
|
|
46
|
+
function X(l, n) {
|
|
47
|
+
var t;
|
|
48
|
+
let e = l;
|
|
49
|
+
for (; e && e !== n; ) {
|
|
50
|
+
if (e.matches(M) || (((t = e.getAttribute("role")) == null ? void 0 : t.split(/\s+/)) ?? []).some((o) => Y.has(o)))
|
|
51
|
+
return !0;
|
|
52
|
+
e = e.parentElement;
|
|
53
|
+
}
|
|
54
|
+
return !1;
|
|
55
|
+
}
|
|
56
|
+
function W(l, n, e) {
|
|
57
|
+
return l === void 0 ? n : e ? e(l) : l instanceof Date ? Number.isNaN(l.getTime()) ? "Invalid Date" : l.toISOString().slice(0, 10) : typeof l == "boolean" ? l ? "Yes" : "No" : l;
|
|
58
|
+
}
|
|
59
|
+
function $(l) {
|
|
60
|
+
if (typeof l == "number" || typeof l == "string")
|
|
61
|
+
return String(l);
|
|
62
|
+
}
|
|
63
|
+
function j(l) {
|
|
64
|
+
for (const n of B.toArray(l)) {
|
|
65
|
+
if (x(n) && n.type === L) {
|
|
66
|
+
if (j(n.props.children)) return !0;
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
return !0;
|
|
70
|
+
}
|
|
71
|
+
return !1;
|
|
72
|
+
}
|
|
73
|
+
function q(l, n) {
|
|
74
|
+
let e = !1;
|
|
75
|
+
function t(o) {
|
|
76
|
+
return B.map(o, (a) => x(a) ? a.type === L ? A(
|
|
77
|
+
a,
|
|
78
|
+
void 0,
|
|
79
|
+
t(
|
|
80
|
+
a.props.children
|
|
81
|
+
)
|
|
82
|
+
) : !e && a.type === D ? (e = !0, A(
|
|
83
|
+
a,
|
|
84
|
+
{ rowTrigger: n }
|
|
85
|
+
)) : a : a);
|
|
86
|
+
}
|
|
87
|
+
const r = t(l);
|
|
88
|
+
return { attached: e, content: r };
|
|
89
|
+
}
|
|
90
|
+
const G = h(
|
|
91
|
+
function(n, e) {
|
|
92
|
+
const { children: t, className: r, ...o } = n;
|
|
93
|
+
return /* @__PURE__ */ c(
|
|
94
|
+
"thead",
|
|
95
|
+
{
|
|
96
|
+
...o,
|
|
97
|
+
ref: e,
|
|
98
|
+
className: ["nk-table__head", r].filter(Boolean).join(" "),
|
|
99
|
+
children: t
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
), J = h(
|
|
104
|
+
function(n, e) {
|
|
105
|
+
const {
|
|
106
|
+
children: t,
|
|
107
|
+
className: r,
|
|
108
|
+
emptyColumnCount: o = 1,
|
|
109
|
+
emptyMessage: a,
|
|
110
|
+
...u
|
|
111
|
+
} = n, d = !j(t), m = Number.isFinite(o) ? Math.max(1, Math.floor(o)) : 1;
|
|
112
|
+
return /* @__PURE__ */ c(
|
|
113
|
+
"tbody",
|
|
114
|
+
{
|
|
115
|
+
...u,
|
|
116
|
+
ref: e,
|
|
117
|
+
className: ["nk-table__body", r].filter(Boolean).join(" "),
|
|
118
|
+
children: d && a !== void 0 ? /* @__PURE__ */ c("tr", { className: "nk-table__row", children: /* @__PURE__ */ c(
|
|
119
|
+
"td",
|
|
120
|
+
{
|
|
121
|
+
className: "nk-table__cell nk-table__empty-cell",
|
|
122
|
+
colSpan: m,
|
|
123
|
+
children: /* @__PURE__ */ c("div", { className: "nk-table__empty-content", children: a })
|
|
124
|
+
}
|
|
125
|
+
) }) : t
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
), Q = h(
|
|
130
|
+
function(n, e) {
|
|
131
|
+
const { children: t, className: r, ...o } = n;
|
|
132
|
+
return /* @__PURE__ */ c(
|
|
133
|
+
"tfoot",
|
|
134
|
+
{
|
|
135
|
+
...o,
|
|
136
|
+
ref: e,
|
|
137
|
+
className: ["nk-table__foot", r].filter(Boolean).join(" "),
|
|
138
|
+
children: t
|
|
139
|
+
}
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
), U = h(
|
|
143
|
+
function(n, e) {
|
|
144
|
+
const {
|
|
145
|
+
"aria-label": t,
|
|
146
|
+
children: r,
|
|
147
|
+
className: o,
|
|
148
|
+
download: a,
|
|
149
|
+
href: u,
|
|
150
|
+
hrefLang: d,
|
|
151
|
+
onClick: m,
|
|
152
|
+
onNavigate: k,
|
|
153
|
+
rel: i,
|
|
154
|
+
target: y,
|
|
155
|
+
...g
|
|
156
|
+
} = n, C = P(null), _ = u !== void 0 || m !== void 0, R = (t == null ? void 0 : t.trim()) || (u !== void 0 ? "Open row" : "Activate row");
|
|
157
|
+
function p(s) {
|
|
158
|
+
C.current = s;
|
|
159
|
+
}
|
|
160
|
+
const v = u !== void 0 ? {
|
|
161
|
+
ariaLabel: R,
|
|
162
|
+
kind: "link",
|
|
163
|
+
linkProperties: {
|
|
164
|
+
download: a,
|
|
165
|
+
href: u,
|
|
166
|
+
hrefLang: d,
|
|
167
|
+
onNavigate: k,
|
|
168
|
+
rel: i,
|
|
169
|
+
target: y
|
|
170
|
+
},
|
|
171
|
+
reference: p
|
|
172
|
+
} : m !== void 0 ? {
|
|
173
|
+
ariaLabel: R,
|
|
174
|
+
kind: "button",
|
|
175
|
+
onClick: m,
|
|
176
|
+
reference: p
|
|
177
|
+
} : void 0, N = v ? q(r, v) : { content: r };
|
|
178
|
+
function E(s) {
|
|
179
|
+
if (s.defaultPrevented) return;
|
|
180
|
+
const f = s.target;
|
|
181
|
+
if (!(f instanceof Element) || X(f, s.currentTarget)) return;
|
|
182
|
+
const T = C.current;
|
|
183
|
+
if (!T) return;
|
|
184
|
+
const b = T.ownerDocument.defaultView;
|
|
185
|
+
if (!b) {
|
|
186
|
+
T.click();
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
T.dispatchEvent(new b.MouseEvent("click", {
|
|
190
|
+
altKey: s.altKey,
|
|
191
|
+
bubbles: !0,
|
|
192
|
+
button: s.button,
|
|
193
|
+
buttons: s.buttons,
|
|
194
|
+
cancelable: !0,
|
|
195
|
+
clientX: s.clientX,
|
|
196
|
+
clientY: s.clientY,
|
|
197
|
+
ctrlKey: s.ctrlKey,
|
|
198
|
+
metaKey: s.metaKey,
|
|
199
|
+
shiftKey: s.shiftKey
|
|
200
|
+
}));
|
|
201
|
+
}
|
|
202
|
+
return /* @__PURE__ */ c(
|
|
203
|
+
"tr",
|
|
204
|
+
{
|
|
205
|
+
...g,
|
|
206
|
+
ref: e,
|
|
207
|
+
"aria-label": _ ? void 0 : t,
|
|
208
|
+
className: ["nk-table__row", o].filter(Boolean).join(" "),
|
|
209
|
+
"data-interactive": _ || void 0,
|
|
210
|
+
onClick: _ ? E : void 0,
|
|
211
|
+
children: N.content
|
|
212
|
+
}
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
), I = h(function(n, e) {
|
|
216
|
+
const {
|
|
217
|
+
align: t = "left",
|
|
218
|
+
children: r,
|
|
219
|
+
className: o,
|
|
220
|
+
scope: a = "col",
|
|
221
|
+
sticky: u = !1,
|
|
222
|
+
...d
|
|
223
|
+
} = n;
|
|
224
|
+
return /* @__PURE__ */ c(
|
|
225
|
+
"th",
|
|
226
|
+
{
|
|
227
|
+
...d,
|
|
228
|
+
ref: e,
|
|
229
|
+
className: ["nk-table__header-cell", o].filter(Boolean).join(" "),
|
|
230
|
+
"data-align": t,
|
|
231
|
+
"data-sticky": u || void 0,
|
|
232
|
+
scope: a,
|
|
233
|
+
children: r
|
|
234
|
+
}
|
|
235
|
+
);
|
|
236
|
+
}), Z = h(function(n, e) {
|
|
237
|
+
const { children: t, className: r, ...o } = n;
|
|
238
|
+
return /* @__PURE__ */ c(
|
|
239
|
+
I,
|
|
240
|
+
{
|
|
241
|
+
...o,
|
|
242
|
+
ref: e,
|
|
243
|
+
align: "right",
|
|
244
|
+
className: ["nk-table__action-header-cell", r].filter(Boolean).join(" "),
|
|
245
|
+
children: t ?? /* @__PURE__ */ c("span", { className: "nk-table__visually-hidden", children: "Row actions" })
|
|
246
|
+
}
|
|
247
|
+
);
|
|
248
|
+
}), D = h(
|
|
249
|
+
function(n, e) {
|
|
250
|
+
const {
|
|
251
|
+
align: t = "left",
|
|
252
|
+
children: r,
|
|
253
|
+
className: o,
|
|
254
|
+
format: a,
|
|
255
|
+
title: u,
|
|
256
|
+
truncate: d,
|
|
257
|
+
value: m,
|
|
258
|
+
...k
|
|
259
|
+
} = n, { rowTrigger: i, ...y } = k, g = W(m, r, a), C = d === void 0 ? void 0 : { maxWidth: d }, _ = u ?? (d === void 0 ? void 0 : $(g));
|
|
260
|
+
return /* @__PURE__ */ H(
|
|
261
|
+
"td",
|
|
262
|
+
{
|
|
263
|
+
...y,
|
|
264
|
+
ref: e,
|
|
265
|
+
className: ["nk-table__cell", o].filter(Boolean).join(" "),
|
|
266
|
+
"data-align": t,
|
|
267
|
+
title: _,
|
|
268
|
+
children: [
|
|
269
|
+
(i == null ? void 0 : i.kind) === "link" && i.linkProperties ? /* @__PURE__ */ c(
|
|
270
|
+
"a",
|
|
271
|
+
{
|
|
272
|
+
ref: i.reference,
|
|
273
|
+
"aria-label": i.ariaLabel,
|
|
274
|
+
className: "nk-table__row-trigger",
|
|
275
|
+
download: i.linkProperties.download,
|
|
276
|
+
href: i.linkProperties.href,
|
|
277
|
+
hrefLang: i.linkProperties.hrefLang,
|
|
278
|
+
onClick: i.linkProperties.onNavigate,
|
|
279
|
+
rel: i.linkProperties.rel,
|
|
280
|
+
target: i.linkProperties.target
|
|
281
|
+
}
|
|
282
|
+
) : null,
|
|
283
|
+
(i == null ? void 0 : i.kind) === "button" ? /* @__PURE__ */ c(
|
|
284
|
+
"button",
|
|
285
|
+
{
|
|
286
|
+
ref: i.reference,
|
|
287
|
+
"aria-label": i.ariaLabel,
|
|
288
|
+
className: "nk-table__row-trigger",
|
|
289
|
+
onClick: i.onClick,
|
|
290
|
+
type: "button"
|
|
291
|
+
}
|
|
292
|
+
) : null,
|
|
293
|
+
d !== void 0 ? /* @__PURE__ */ c("span", { className: "nk-table__truncated-content", style: C, children: g }) : g
|
|
294
|
+
]
|
|
295
|
+
}
|
|
296
|
+
);
|
|
297
|
+
}
|
|
298
|
+
), ee = h(
|
|
299
|
+
function(n, e) {
|
|
300
|
+
const {
|
|
301
|
+
"aria-label": t,
|
|
302
|
+
icon: r,
|
|
303
|
+
label: o,
|
|
304
|
+
...a
|
|
305
|
+
} = n;
|
|
306
|
+
return /* @__PURE__ */ c(z, { content: o, children: /* @__PURE__ */ c(
|
|
307
|
+
V,
|
|
308
|
+
{
|
|
309
|
+
...a,
|
|
310
|
+
ref: e,
|
|
311
|
+
"aria-label": t ?? o,
|
|
312
|
+
className: "nk-table__action",
|
|
313
|
+
icon: r,
|
|
314
|
+
shape: "rectangle",
|
|
315
|
+
type: "button",
|
|
316
|
+
variant: "ghost"
|
|
317
|
+
}
|
|
318
|
+
) });
|
|
319
|
+
}
|
|
320
|
+
), te = h(function(n, e) {
|
|
321
|
+
const { children: t, className: r, onClick: o, ...a } = n;
|
|
322
|
+
function u(d) {
|
|
323
|
+
d.stopPropagation(), o == null || o(d);
|
|
324
|
+
}
|
|
325
|
+
return /* @__PURE__ */ c(
|
|
326
|
+
"td",
|
|
327
|
+
{
|
|
328
|
+
...a,
|
|
329
|
+
ref: e,
|
|
330
|
+
className: ["nk-table__cell", "nk-table__action-cell", r].filter(Boolean).join(" "),
|
|
331
|
+
"data-align": "right",
|
|
332
|
+
onClick: u,
|
|
333
|
+
children: /* @__PURE__ */ c("span", { className: "nk-table__action-list", children: t })
|
|
334
|
+
}
|
|
335
|
+
);
|
|
336
|
+
}), ne = h(function(n, e) {
|
|
337
|
+
const {
|
|
338
|
+
"aria-label": t,
|
|
339
|
+
children: r,
|
|
340
|
+
className: o,
|
|
341
|
+
containerClassName: a,
|
|
342
|
+
...u
|
|
343
|
+
} = n, d = P(null), m = P(null), [k, i] = w(!1), [y, g] = w(!1), C = t ? `${t} scroll area` : "Scrollable table", _ = O(
|
|
344
|
+
(p) => {
|
|
345
|
+
m.current = p, F(e, p);
|
|
346
|
+
},
|
|
347
|
+
[e]
|
|
348
|
+
);
|
|
349
|
+
K(() => {
|
|
350
|
+
const p = d.current, v = m.current;
|
|
351
|
+
if (!p || !v) return;
|
|
352
|
+
const N = p, E = v;
|
|
353
|
+
function s() {
|
|
354
|
+
const S = N.scrollWidth > N.clientWidth;
|
|
355
|
+
i(S), S || g(!1);
|
|
356
|
+
}
|
|
357
|
+
s();
|
|
358
|
+
const f = N.ownerDocument.defaultView;
|
|
359
|
+
f == null || f.addEventListener("resize", s);
|
|
360
|
+
const T = f == null ? void 0 : f.ResizeObserver, b = T ? new T(s) : void 0;
|
|
361
|
+
return b == null || b.observe(N), b == null || b.observe(E), () => {
|
|
362
|
+
f == null || f.removeEventListener("resize", s), b == null || b.disconnect();
|
|
363
|
+
};
|
|
364
|
+
}, []);
|
|
365
|
+
function R(p) {
|
|
366
|
+
g(k && p.currentTarget.scrollLeft > 1);
|
|
367
|
+
}
|
|
368
|
+
return /* @__PURE__ */ c(
|
|
369
|
+
"div",
|
|
370
|
+
{
|
|
371
|
+
ref: d,
|
|
372
|
+
"aria-label": k ? C : void 0,
|
|
373
|
+
className: ["nk-table__container", a].filter(Boolean).join(" "),
|
|
374
|
+
"data-scrolled": y || void 0,
|
|
375
|
+
onScroll: R,
|
|
376
|
+
role: k ? "region" : void 0,
|
|
377
|
+
tabIndex: k ? 0 : void 0,
|
|
378
|
+
children: /* @__PURE__ */ c(
|
|
379
|
+
"table",
|
|
380
|
+
{
|
|
381
|
+
...u,
|
|
382
|
+
ref: _,
|
|
383
|
+
"aria-label": t,
|
|
384
|
+
className: ["nk-table", o].filter(Boolean).join(" "),
|
|
385
|
+
children: r
|
|
386
|
+
}
|
|
387
|
+
)
|
|
388
|
+
}
|
|
389
|
+
);
|
|
390
|
+
}), ce = Object.assign(ne, {
|
|
391
|
+
Action: ee,
|
|
392
|
+
ActionCell: te,
|
|
393
|
+
ActionHeaderCell: Z,
|
|
394
|
+
Body: J,
|
|
395
|
+
Cell: D,
|
|
396
|
+
Foot: Q,
|
|
397
|
+
HeaderCell: I,
|
|
398
|
+
Head: G,
|
|
399
|
+
Row: U
|
|
400
|
+
});
|
|
401
|
+
export {
|
|
402
|
+
ce as T
|
|
403
|
+
};
|
package/dist/Table.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Table-83unQQOi.cjs");exports.default=e.Table;
|
package/dist/Table.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react"),f=e.forwardRef(function(t,a){const{align:n="left",as:s,className:o,size:r="body",tone:i="default",weight:l,...c}=t,d=s??"p";return e.createElement(d,{...c,ref:a,className:["nk-text",o].filter(Boolean).join(" "),"data-align":n,"data-size":r,"data-tone":i,"data-weight":l})});exports.Text=f;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { forwardRef as f, createElement as m } from "react";
|
|
2
|
+
const g = f(function(e, t) {
|
|
3
|
+
const {
|
|
4
|
+
align: a = "left",
|
|
5
|
+
as: n,
|
|
6
|
+
className: o,
|
|
7
|
+
size: l = "body",
|
|
8
|
+
tone: s = "default",
|
|
9
|
+
weight: r,
|
|
10
|
+
...i
|
|
11
|
+
} = e;
|
|
12
|
+
return m(n ?? "p", {
|
|
13
|
+
...i,
|
|
14
|
+
ref: t,
|
|
15
|
+
className: ["nk-text", o].filter(Boolean).join(" "),
|
|
16
|
+
"data-align": a,
|
|
17
|
+
"data-size": l,
|
|
18
|
+
"data-tone": s,
|
|
19
|
+
"data-weight": r
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
export {
|
|
23
|
+
g as T
|
|
24
|
+
};
|
package/dist/Text.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Text-DWYlIcPj.cjs");exports.default=e.Text;
|
package/dist/Text.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const R=require("react/jsx-runtime"),M=require("react"),n=require("./aria-DKxpE8cA.cjs");function s(e){return Number.isFinite(e)?Math.max(1,Math.floor(e)):1}const b=M.forwardRef(function(o,l){const{"aria-invalid":a,className:d,disabled:c=!1,invalid:t=!1,minRows:r,readOnly:u=!1,resize:v="vertical",rows:i,style:m,...f}=o,x=s(i??r??3),w=`calc(${s(r??i??3)*1.25}em + var(--nk-text-area-padding) * 2 + var(--nk-text-area-border-width) * 2)`,h={...m,"--nk-text-area-min-height":w};return R.jsx("textarea",{...f,ref:l,"aria-invalid":n.resolveAriaInvalid(t,a),className:["nk-text-area",d].filter(Boolean).join(" "),"data-invalid":t||n.hasInvalidState(a)||void 0,"data-resize":v,disabled:c,readOnly:u,rows:x,style:h})});exports.default=b;
|
package/dist/TextArea.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as p } from "react";
|
|
3
|
+
import { h as R, r as A } from "./aria-DHnOMyYp.js";
|
|
4
|
+
function o(a) {
|
|
5
|
+
return Number.isFinite(a) ? Math.max(1, Math.floor(a)) : 1;
|
|
6
|
+
}
|
|
7
|
+
const g = p(
|
|
8
|
+
function(s, n) {
|
|
9
|
+
const {
|
|
10
|
+
"aria-invalid": e,
|
|
11
|
+
className: l,
|
|
12
|
+
disabled: d = !1,
|
|
13
|
+
invalid: r = !1,
|
|
14
|
+
minRows: t,
|
|
15
|
+
readOnly: m = !1,
|
|
16
|
+
resize: v = "vertical",
|
|
17
|
+
rows: i,
|
|
18
|
+
style: f,
|
|
19
|
+
...c
|
|
20
|
+
} = s, x = o(i ?? t ?? 3), h = `calc(${o(t ?? i ?? 3) * 1.25}em + var(--nk-text-area-padding) * 2 + var(--nk-text-area-border-width) * 2)`, w = {
|
|
21
|
+
...f,
|
|
22
|
+
"--nk-text-area-min-height": h
|
|
23
|
+
};
|
|
24
|
+
return /* @__PURE__ */ u(
|
|
25
|
+
"textarea",
|
|
26
|
+
{
|
|
27
|
+
...c,
|
|
28
|
+
ref: n,
|
|
29
|
+
"aria-invalid": A(r, e),
|
|
30
|
+
className: ["nk-text-area", l].filter(Boolean).join(" "),
|
|
31
|
+
"data-invalid": r || R(e) || void 0,
|
|
32
|
+
"data-resize": v,
|
|
33
|
+
disabled: d,
|
|
34
|
+
readOnly: m,
|
|
35
|
+
rows: x,
|
|
36
|
+
style: w
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
export {
|
|
42
|
+
g as default
|
|
43
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";const T=require("react/jsx-runtime"),n=require("react"),V=require("./reference-C2guRuR0.cjs"),_=require("./usePresence-qe92UTvK.cjs"),Re=require("./useFloatingPosition-D1FqYy0l.cjs"),Ee=require("./focus-restoration-70WcQRr5.cjs"),De=require("./Surface-BttJYSDt.cjs"),be=500,G=n.createContext(null);function ge(o){const{children:a,delay:c=be}=o,l=n.useMemo(()=>({delay:c}),[c]);return T.jsx(G.Provider,{value:l,children:a})}const J=500,$=100;function Ie(o,a,c,l){a.current=o,V.assignElementReference(c,o),V.assignElementReference(l,o)}function he(o){return Number.isFinite(o)?Math.max(0,o):J}function ye(o,a){const c=(o==null?void 0:o.split(/\s+/).filter(Boolean))??[];return c.includes(a)||c.push(a),c.join(" ")}const Fe=n.forwardRef(function(a,c){const{children:l,className:K,content:m,contentClassName:Q,contentStyle:A,delay:X,disabled:w=!1,onOpenChange:F,placement:z="top",portalContainer:L,style:Z}=a;if(m==null||typeof m=="boolean"||typeof m=="string"&&!m.trim())throw new Error("Tooltip content must not be empty");if(l.type===n.Fragment)throw new Error("Tooltip requires a single non-Fragment trigger");const B=`${n.useId()}-tooltip`,x=n.useContext(G),r=l.props,Y=V.getElementReference(l),R=n.useRef(null),P=n.useRef(null),H=n.useRef(w),j=n.useRef(!1),v=n.useRef(null),k=n.useRef(null),M=n.useRef(null),C=n.useRef(!1),E=n.useRef(!1),D=n.useRef(!1),f=n.useRef(!1),[b,ee]=n.useState(null),[ne,te]=n.useState(null),[O,re]=n.useState(!1);H.current=w;const q=he(X??(x==null?void 0:x.delay)??J),g=_.usePresence(O),N=(L==null?void 0:L.ownerDocument)??(b==null?void 0:b.ownerDocument)??(typeof document>"u"?null:document),W=_.useOverlayLayer(g.present,N),d=Re.useFloatingPosition(g.present,z,b,ne),oe=n.useMemo(()=>[R,P],[]),se=ye(r["aria-describedby"],B),ce=O&&g.present?se:r["aria-describedby"],U=n.useCallback(e=>{Ie(e,R,Y,c),ee(e)},[c,Y]),ue=n.useCallback(e=>{P.current=e,e||(f.current=!1),te(e)},[]),u=n.useCallback(()=>{const e=v.current;e&&e.ownerWindow.clearTimeout(e.timerId),v.current=null},[]),i=n.useCallback(()=>{const e=k.current;e&&e.ownerWindow.clearTimeout(e.timerId),k.current=null},[]),I=n.useCallback(()=>{const e=M.current;e&&e.ownerWindow.clearTimeout(e.timerId),M.current=null},[]),s=n.useCallback(e=>{j.current!==e&&(e||(f.current=!1),j.current=e,re(e),F==null||F(e))},[F]),S=n.useCallback(e=>{var h,y;if(i(),E.current||D.current||f.current)return;if(e===0){s(!1);return}const t=((h=R.current)==null?void 0:h.ownerDocument.defaultView)??((y=P.current)==null?void 0:y.ownerDocument.defaultView);if(!t){s(!1);return}const p=t.setTimeout(()=>{k.current=null,!E.current&&!D.current&&!f.current&&s(!1)},e);k.current={ownerWindow:t,timerId:p}},[i,s]),ie=n.useCallback(()=>{var p;if(u(),i(),q===0){s(!0);return}const e=(p=R.current)==null?void 0:p.ownerDocument.defaultView;if(!e)return;const t=e.setTimeout(()=>{v.current=null,H.current||s(!0)},q);v.current={ownerWindow:e,timerId:t}},[i,u,q,s]);function le(e){var t;if((t=r.onFocus)==null||t.call(r,e),E.current=!0,i(),C.current||Ee.isElementFocusRestoration(e.currentTarget)){u();return}u(),s(!0)}function ae(e){var t;(t=r.onBlur)==null||t.call(r,e),!e.currentTarget.contains(e.relatedTarget)&&(E.current=!1,u(),S(0))}function fe(e){var t;(t=r.onMouseEnter)==null||t.call(r,e),D.current=!0,ie()}function de(e){var t;(t=r.onMouseLeave)==null||t.call(r,e),D.current=!1,u(),S($)}function me(){f.current=!0,i()}function pe(){f.current=!1,S($)}function Te(e){var h,y;(h=r.onPointerDown)==null||h.call(r,e),u(),i(),s(!1);const t=(y=R.current)==null?void 0:y.ownerDocument.defaultView;if(!t)return;C.current=!0,I();const p=t.setTimeout(()=>{C.current=!1,M.current=null},0);M.current={ownerWindow:t,timerId:p}}if(_.useDismissableLayer({active:O,boundaries:oe,dismissOnPointerDownOutside:!0,layerId:W.id,onEscapeDismiss:()=>s(!1),onPointerDownOutsideDismiss:()=>s(!1),ownerDocument:N}),n.useEffect(()=>{w&&(u(),i(),I(),C.current=!1,E.current=!1,D.current=!1,f.current=!1,j.current&&s(!1))},[i,u,I,w,s]),n.useEffect(()=>()=>{u(),i(),I()},[i,u,I]),w)return n.cloneElement(l,{ref:U});const we=n.cloneElement(l,{"aria-describedby":ce,className:[r.className,"nk-tooltip__trigger",K].filter(Boolean).join(" "),onBlur:ae,onFocus:le,onMouseEnter:fe,onMouseLeave:de,onPointerDown:Te,ref:U,style:{...r.style,...Z}});return T.jsxs(T.Fragment,{children:[we,g.present&&N?T.jsx(_.Portal,{container:L,inheritFrom:b,children:T.jsxs(De.Surface,{ref:ue,"aria-hidden":O?void 0:!0,className:["nk-tooltip",Q].filter(Boolean).join(" "),"data-placement":(d==null?void 0:d.placement)??z,"data-state":g.state==="closing"?"closing":"open",id:B,onMouseEnter:me,onMouseLeave:pe,role:"tooltip",style:d?{...A,"--nk-tooltip-arrow-offset":`${d.arrowOffset}px`,left:d.left,top:d.top,zIndex:W.zIndex}:{...A,visibility:"hidden",zIndex:W.zIndex},children:[T.jsx("span",{"aria-hidden":"true",className:"nk-tooltip__arrow"}),m]})}):null]})});exports.Tooltip=Fe;exports.TooltipProvider=ge;
|