neatkit 0.7.0 → 0.9.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/Avatar-Belo7qAY.cjs +1 -0
- package/dist/Avatar-DjDCFqNG.js +55 -0
- package/dist/Avatar.cjs +1 -1
- package/dist/Avatar.js +2 -52
- package/dist/Boundary.cjs +1 -0
- package/dist/Boundary.js +176 -0
- package/dist/Button-BV5OUXpc.js +101 -0
- package/dist/Button-DU4j_IED.cjs +1 -0
- package/dist/Button.cjs +1 -1
- package/dist/Button.js +1 -1
- package/dist/Checkbox.cjs +1 -1
- package/dist/Checkbox.js +213 -2
- package/dist/Code-B7s_rN0G.cjs +4 -0
- package/dist/Code-Bp2X1k-g.js +224 -0
- package/dist/Code.cjs +1 -1
- package/dist/Code.js +1 -1
- package/dist/Divider-C7XGlr26.cjs +1 -0
- package/dist/{Divider-BE15WVDI.js → Divider-DZgpYpr-.js} +1 -1
- package/dist/Divider.cjs +1 -1
- package/dist/Divider.js +1 -1
- package/dist/Icon-BIBzgznI.cjs +1 -0
- package/dist/{Icon-uQmpr5P2.js → Icon-CxK1wlGk.js} +194 -181
- package/dist/Icon.cjs +1 -1
- package/dist/Icon.js +2 -35
- package/dist/Input.cjs +1 -1
- package/dist/Input.js +70 -79
- package/dist/Markdown.cjs +1 -31
- package/dist/Markdown.js +469 -18066
- package/dist/Modal.cjs +1 -1
- package/dist/Modal.js +100 -122
- package/dist/PinInput.cjs +1 -1
- package/dist/PinInput.js +1 -1
- package/dist/Popover.cjs +1 -1
- package/dist/Popover.js +171 -165
- package/dist/Radio.cjs +1 -1
- package/dist/Radio.js +86 -41
- package/dist/Select.cjs +1 -1
- package/dist/Select.js +326 -315
- package/dist/Sidebar.cjs +1 -0
- package/dist/Sidebar.js +490 -0
- package/dist/Skeleton.cjs +1 -1
- package/dist/Skeleton.js +20 -16
- package/dist/Switch.cjs +1 -1
- package/dist/Switch.js +1 -1
- package/dist/Table-CADupJEU.js +423 -0
- package/dist/Table-qetwZpTC.cjs +1 -0
- package/dist/Table.cjs +1 -1
- package/dist/Table.js +1 -1
- package/dist/TextArea.cjs +1 -1
- package/dist/TextArea.js +1 -1
- package/dist/Tooltip-B2d5ss7S.cjs +1 -0
- package/dist/Tooltip-BK64rkxV.js +231 -0
- package/dist/Tooltip.cjs +1 -1
- package/dist/Tooltip.js +2 -3
- package/dist/albert-sans-cb3e34c4.woff2 +0 -0
- package/dist/aria-Bntn6ad_.cjs +1 -0
- package/dist/aria-CeA9QfD1.js +15 -0
- package/dist/components/Boundary/Boundary.d.ts +65 -0
- package/dist/components/Boundary/contexts/BoundaryContext.d.ts +28 -0
- package/dist/components/Boundary/hooks/useBoundary.d.ts +19 -0
- package/dist/components/Boundary/hooks/useBoundaryWidth.d.ts +23 -0
- package/dist/components/Boundary/index.d.ts +2 -0
- package/dist/components/Boundary/utils/width.d.ts +11 -0
- package/dist/components/Checkbox/Checkbox.d.ts +9 -1
- package/dist/components/{CheckboxGroup → Checkbox/components}/CheckboxGroup.d.ts +2 -2
- package/dist/components/Checkbox/index.d.ts +1 -0
- package/dist/components/Checkbox/utils/checkbox-option.d.ts +17 -0
- package/dist/components/Icon/Icon.d.ts +1 -0
- package/dist/components/Icon/icons/GearIcon.d.ts +11 -0
- package/dist/components/Icon/icons/ImageIcon.d.ts +11 -0
- package/dist/components/Icon/index.d.ts +0 -33
- package/dist/components/Icon/utils/registry.d.ts +2 -0
- package/dist/components/Input/Input.d.ts +1 -9
- package/dist/components/Modal/Modal.d.ts +0 -4
- package/dist/components/PinInput/PinInput.d.ts +1 -1
- package/dist/components/Popover/Popover.d.ts +2 -6
- package/dist/components/Portal/Portal.d.ts +11 -8
- package/dist/components/Portal/hooks/useDismissableLayer.d.ts +2 -0
- package/dist/components/Portal/hooks/useFloatingPosition.d.ts +4 -3
- package/dist/components/Portal/hooks/useFocusTrap.d.ts +2 -0
- package/dist/components/Portal/hooks/useScrollLock.d.ts +9 -3
- package/dist/components/Portal/utils/boundary-focus.d.ts +23 -0
- package/dist/components/Portal/utils/floating-position.d.ts +43 -9
- package/dist/components/Portal/utils/overlay-stack.d.ts +22 -10
- package/dist/components/Portal/utils/scroll-container.d.ts +13 -0
- package/dist/components/Radio/Radio.d.ts +9 -1
- package/dist/components/{RadioGroup → Radio/components}/RadioGroup.d.ts +9 -2
- package/dist/components/Radio/index.d.ts +1 -0
- package/dist/components/Select/Select.d.ts +0 -2
- package/dist/components/Select/utils/listbox-position.d.ts +28 -0
- package/dist/components/Sidebar/Sidebar.d.ts +113 -0
- package/dist/components/Sidebar/components/SidebarFooter.d.ts +24 -0
- package/dist/components/Sidebar/components/SidebarGroup.d.ts +31 -0
- package/dist/components/Sidebar/components/SidebarHeader.d.ts +29 -0
- package/dist/components/Sidebar/components/SidebarItem.d.ts +46 -0
- package/dist/components/Sidebar/components/SidebarOverlay.d.ts +38 -0
- package/dist/components/Sidebar/components/SidebarPanel.d.ts +47 -0
- package/dist/components/Sidebar/components/SidebarTrigger.d.ts +47 -0
- package/dist/components/Sidebar/components/SidebarUser.d.ts +59 -0
- package/dist/components/Sidebar/hooks/usePresentation.d.ts +14 -0
- package/dist/components/Sidebar/hooks/useSidebar.d.ts +9 -0
- package/dist/components/Sidebar/index.d.ts +2 -0
- package/dist/components/Sidebar/utils/presentation.d.ts +12 -0
- package/dist/components/Sidebar/utils/state.d.ts +62 -0
- package/dist/components/Skeleton/Skeleton.d.ts +21 -5
- package/dist/components/Table/Table.d.ts +21 -249
- package/dist/components/Table/components/TableAction.d.ts +18 -0
- package/dist/components/Table/components/TableActionCell.d.ts +15 -0
- package/dist/components/Table/components/TableActionHeaderCell.d.ts +13 -0
- package/dist/components/Table/components/TableBody.d.ts +27 -0
- package/dist/components/Table/components/TableCell.d.ts +42 -0
- package/dist/components/Table/components/TableFoot.d.ts +19 -0
- package/dist/components/Table/components/TableHead.d.ts +19 -0
- package/dist/components/Table/components/TableHeaderCell.d.ts +23 -0
- package/dist/components/Table/components/TableRow.d.ts +67 -0
- package/dist/components/Table/contexts/TableContext.d.ts +4 -0
- package/dist/components/Table/hooks/useHorizontalOverflow.d.ts +25 -0
- package/dist/components/Table/index.d.ts +1 -1
- package/dist/components/Table/utils/cell.d.ts +25 -0
- package/dist/components/Table/utils/children.d.ts +18 -0
- package/dist/components/Table/utils/trigger.d.ts +54 -0
- package/dist/components/Tooltip/Tooltip.d.ts +10 -4
- package/dist/components/Tooltip/TooltipProvider.d.ts +1 -1
- package/dist/components/Tooltip/index.d.ts +0 -1
- package/dist/effects-D5CWf-Pl.js +8 -0
- package/dist/effects-D85L_7zM.cjs +1 -0
- package/dist/floating-position-DIjh2wnP.cjs +1 -0
- package/dist/floating-position-DvR6e334.js +50 -0
- package/dist/style.css +1 -1
- package/dist/tokens.d.ts +1 -0
- package/dist/useFloatingPosition-B3ZC-v3v.js +43 -0
- package/dist/useFloatingPosition-GzkP9dCc.cjs +1 -0
- package/dist/useFocusTrap-BrFZdMqQ.cjs +1 -0
- package/dist/useFocusTrap-DhVnlboe.js +136 -0
- package/dist/usePresence-B5RYv4e1.cjs +1 -0
- package/dist/usePresence-CqegYqy4.js +221 -0
- package/dist/useScrollLock-Drd7OZRC.js +62 -0
- package/dist/useScrollLock-Dy8MZaSn.cjs +1 -0
- package/dist/utils/aria.d.ts +9 -0
- package/dist/utils/effects.d.ts +12 -0
- package/package.json +12 -16
- package/dist/Button-BAsLfA0D.js +0 -99
- package/dist/Button-D7JUO6Fs.cjs +0 -1
- package/dist/Checkbox-BvXM9VyY.js +0 -68
- package/dist/Checkbox-VQifZrZZ.cjs +0 -1
- package/dist/CheckboxGroup.cjs +0 -1
- package/dist/CheckboxGroup.js +0 -144
- package/dist/Code-BP2ZCmUf.js +0 -7446
- package/dist/Code-eispVOW3.cjs +0 -6
- package/dist/Content.cjs +0 -1
- package/dist/Content.js +0 -144
- package/dist/Divider-CJYbFcSX.cjs +0 -1
- package/dist/Icon-D8IZceys.cjs +0 -1
- package/dist/RadioGroup.cjs +0 -1
- package/dist/RadioGroup.js +0 -51
- package/dist/RadioGroupContext-BX9KnDek.cjs +0 -1
- package/dist/RadioGroupContext-DbKM4zPZ.js +0 -5
- package/dist/Table-83unQQOi.cjs +0 -1
- package/dist/Table-Cw8u-pEW.js +0 -403
- package/dist/Tooltip-BB82wNOE.cjs +0 -1
- package/dist/Tooltip-CqWK_GRD.js +0 -236
- package/dist/aria-DHnOMyYp.js +0 -10
- package/dist/aria-DKxpE8cA.cjs +0 -1
- package/dist/components/CheckboxGroup/index.d.ts +0 -2
- package/dist/components/Content/Content.d.ts +0 -60
- package/dist/components/Content/hooks/useContentLayout.d.ts +0 -18
- package/dist/components/Content/index.d.ts +0 -2
- package/dist/components/Content/utils/layout.d.ts +0 -11
- package/dist/components/RadioGroup/index.d.ts +0 -2
- package/dist/useFloatingPosition-CxzhAvy8.js +0 -73
- package/dist/useFloatingPosition-D1FqYy0l.cjs +0 -1
- package/dist/useFocusTrap--cgjy78G.cjs +0 -1
- package/dist/useFocusTrap-Da4nEash.js +0 -134
- package/dist/usePresence-DSPt6aKi.js +0 -210
- package/dist/usePresence-qe92UTvK.cjs +0 -1
- /package/dist/components/{CheckboxGroup → Checkbox}/contexts/CheckboxGroupContext.d.ts +0 -0
- /package/dist/components/{CheckboxGroup → Checkbox}/hooks/useCheckboxGroup.d.ts +0 -0
- /package/dist/components/{RadioGroup → Radio}/contexts/RadioGroupContext.d.ts +0 -0
- /package/dist/components/{RadioGroup → Radio}/hooks/useRadioGroup.d.ts +0 -0
package/dist/Table-83unQQOi.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
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=$;
|
package/dist/Table-Cw8u-pEW.js
DELETED
|
@@ -1,403 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
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;
|
package/dist/Tooltip-CqWK_GRD.js
DELETED
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as C, jsxs as q, Fragment as he } from "react/jsx-runtime";
|
|
3
|
-
import { useMemo as X, createContext as ye, forwardRef as be, Fragment as Fe, useId as Le, useContext as ve, useRef as u, useState as z, useCallback as f, useEffect as G, cloneElement as J } from "react";
|
|
4
|
-
import { g as Me, a as K } from "./reference-CXMr27nM.js";
|
|
5
|
-
import { a as Oe, b as _e, c as xe, P as Ne } from "./usePresence-DSPt6aKi.js";
|
|
6
|
-
import { u as Pe } from "./useFloatingPosition-CxzhAvy8.js";
|
|
7
|
-
import { i as We } from "./focus-restoration-BvNZzrQA.js";
|
|
8
|
-
import { S as ke } from "./Surface-vEFsZC12.js";
|
|
9
|
-
const Ve = 500, Z = ye(null);
|
|
10
|
-
function Ge(r) {
|
|
11
|
-
const { children: a, delay: s = Ve } = r, l = X(() => ({
|
|
12
|
-
delay: s
|
|
13
|
-
}), [s]);
|
|
14
|
-
return /* @__PURE__ */ C(Z.Provider, { value: l, children: a });
|
|
15
|
-
}
|
|
16
|
-
const ee = 500, Q = 100;
|
|
17
|
-
function Ae(r, a, s, l) {
|
|
18
|
-
a.current = r, K(s, r), K(l, r);
|
|
19
|
-
}
|
|
20
|
-
function je(r) {
|
|
21
|
-
return Number.isFinite(r) ? Math.max(0, r) : ee;
|
|
22
|
-
}
|
|
23
|
-
function ze(r, a) {
|
|
24
|
-
const s = (r == null ? void 0 : r.split(/\s+/).filter(Boolean)) ?? [];
|
|
25
|
-
return s.includes(a) || s.push(a), s.join(" ");
|
|
26
|
-
}
|
|
27
|
-
const Je = be(function(a, s) {
|
|
28
|
-
const {
|
|
29
|
-
children: l,
|
|
30
|
-
className: ne,
|
|
31
|
-
content: p,
|
|
32
|
-
contentClassName: te,
|
|
33
|
-
contentStyle: S,
|
|
34
|
-
delay: re,
|
|
35
|
-
disabled: w = !1,
|
|
36
|
-
onOpenChange: F,
|
|
37
|
-
placement: B = "top",
|
|
38
|
-
portalContainer: L,
|
|
39
|
-
style: oe
|
|
40
|
-
} = a;
|
|
41
|
-
if (p == null || typeof p == "boolean" || typeof p == "string" && !p.trim())
|
|
42
|
-
throw new Error("Tooltip content must not be empty");
|
|
43
|
-
if (l.type === Fe)
|
|
44
|
-
throw new Error("Tooltip requires a single non-Fragment trigger");
|
|
45
|
-
const Y = `${Le()}-tooltip`, N = ve(Z), t = l.props, $ = Me(l), D = u(null), P = u(null), H = u(w), W = u(!1), v = u(null), M = u(null), O = u(null), _ = u(!1), E = u(!1), g = u(!1), d = u(!1), [I, se] = z(null), [ce, ie] = z(null), [x, ue] = z(!1);
|
|
46
|
-
H.current = w;
|
|
47
|
-
const k = je(
|
|
48
|
-
re ?? (N == null ? void 0 : N.delay) ?? ee
|
|
49
|
-
), R = Oe(x), V = (L == null ? void 0 : L.ownerDocument) ?? (I == null ? void 0 : I.ownerDocument) ?? (typeof document > "u" ? null : document), A = _e(R.present, V), m = Pe(
|
|
50
|
-
R.present,
|
|
51
|
-
B,
|
|
52
|
-
I,
|
|
53
|
-
ce
|
|
54
|
-
), le = X(
|
|
55
|
-
() => [D, P],
|
|
56
|
-
[]
|
|
57
|
-
), ae = ze(
|
|
58
|
-
t["aria-describedby"],
|
|
59
|
-
Y
|
|
60
|
-
), fe = x && R.present ? ae : t["aria-describedby"], U = f(
|
|
61
|
-
(e) => {
|
|
62
|
-
Ae(
|
|
63
|
-
e,
|
|
64
|
-
D,
|
|
65
|
-
$,
|
|
66
|
-
s
|
|
67
|
-
), se(e);
|
|
68
|
-
},
|
|
69
|
-
[s, $]
|
|
70
|
-
), de = f(
|
|
71
|
-
(e) => {
|
|
72
|
-
P.current = e, e || (d.current = !1), ie(e);
|
|
73
|
-
},
|
|
74
|
-
[]
|
|
75
|
-
), c = f(() => {
|
|
76
|
-
const e = v.current;
|
|
77
|
-
e && e.ownerWindow.clearTimeout(e.timerId), v.current = null;
|
|
78
|
-
}, []), i = f(() => {
|
|
79
|
-
const e = M.current;
|
|
80
|
-
e && e.ownerWindow.clearTimeout(e.timerId), M.current = null;
|
|
81
|
-
}, []), h = f(() => {
|
|
82
|
-
const e = O.current;
|
|
83
|
-
e && e.ownerWindow.clearTimeout(e.timerId), O.current = null;
|
|
84
|
-
}, []), o = f((e) => {
|
|
85
|
-
W.current !== e && (e || (d.current = !1), W.current = e, ue(e), F == null || F(e));
|
|
86
|
-
}, [F]), j = f((e) => {
|
|
87
|
-
var y, b;
|
|
88
|
-
if (i(), E.current || g.current || d.current)
|
|
89
|
-
return;
|
|
90
|
-
if (e === 0) {
|
|
91
|
-
o(!1);
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
const n = ((y = D.current) == null ? void 0 : y.ownerDocument.defaultView) ?? ((b = P.current) == null ? void 0 : b.ownerDocument.defaultView);
|
|
95
|
-
if (!n) {
|
|
96
|
-
o(!1);
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
const T = n.setTimeout(() => {
|
|
100
|
-
M.current = null, !E.current && !g.current && !d.current && o(!1);
|
|
101
|
-
}, e);
|
|
102
|
-
M.current = {
|
|
103
|
-
ownerWindow: n,
|
|
104
|
-
timerId: T
|
|
105
|
-
};
|
|
106
|
-
}, [i, o]), me = f(() => {
|
|
107
|
-
var T;
|
|
108
|
-
if (c(), i(), k === 0) {
|
|
109
|
-
o(!0);
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
const e = (T = D.current) == null ? void 0 : T.ownerDocument.defaultView;
|
|
113
|
-
if (!e) return;
|
|
114
|
-
const n = e.setTimeout(() => {
|
|
115
|
-
v.current = null, H.current || o(!0);
|
|
116
|
-
}, k);
|
|
117
|
-
v.current = { ownerWindow: e, timerId: n };
|
|
118
|
-
}, [i, c, k, o]);
|
|
119
|
-
function pe(e) {
|
|
120
|
-
var n;
|
|
121
|
-
if ((n = t.onFocus) == null || n.call(t, e), E.current = !0, i(), _.current || We(e.currentTarget)) {
|
|
122
|
-
c();
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
c(), o(!0);
|
|
126
|
-
}
|
|
127
|
-
function Te(e) {
|
|
128
|
-
var n;
|
|
129
|
-
(n = t.onBlur) == null || n.call(t, e), !e.currentTarget.contains(e.relatedTarget) && (E.current = !1, c(), j(0));
|
|
130
|
-
}
|
|
131
|
-
function we(e) {
|
|
132
|
-
var n;
|
|
133
|
-
(n = t.onMouseEnter) == null || n.call(t, e), g.current = !0, me();
|
|
134
|
-
}
|
|
135
|
-
function De(e) {
|
|
136
|
-
var n;
|
|
137
|
-
(n = t.onMouseLeave) == null || n.call(t, e), g.current = !1, c(), j(Q);
|
|
138
|
-
}
|
|
139
|
-
function Ee() {
|
|
140
|
-
d.current = !0, i();
|
|
141
|
-
}
|
|
142
|
-
function ge() {
|
|
143
|
-
d.current = !1, j(Q);
|
|
144
|
-
}
|
|
145
|
-
function Ie(e) {
|
|
146
|
-
var y, b;
|
|
147
|
-
(y = t.onPointerDown) == null || y.call(t, e), c(), i(), o(!1);
|
|
148
|
-
const n = (b = D.current) == null ? void 0 : b.ownerDocument.defaultView;
|
|
149
|
-
if (!n) return;
|
|
150
|
-
_.current = !0, h();
|
|
151
|
-
const T = n.setTimeout(() => {
|
|
152
|
-
_.current = !1, O.current = null;
|
|
153
|
-
}, 0);
|
|
154
|
-
O.current = { ownerWindow: n, timerId: T };
|
|
155
|
-
}
|
|
156
|
-
if (xe({
|
|
157
|
-
active: x,
|
|
158
|
-
boundaries: le,
|
|
159
|
-
dismissOnPointerDownOutside: !0,
|
|
160
|
-
layerId: A.id,
|
|
161
|
-
onEscapeDismiss: () => o(!1),
|
|
162
|
-
onPointerDownOutsideDismiss: () => o(!1),
|
|
163
|
-
ownerDocument: V
|
|
164
|
-
}), G(() => {
|
|
165
|
-
w && (c(), i(), h(), _.current = !1, E.current = !1, g.current = !1, d.current = !1, W.current && o(!1));
|
|
166
|
-
}, [
|
|
167
|
-
i,
|
|
168
|
-
c,
|
|
169
|
-
h,
|
|
170
|
-
w,
|
|
171
|
-
o
|
|
172
|
-
]), G(() => () => {
|
|
173
|
-
c(), i(), h();
|
|
174
|
-
}, [i, c, h]), w)
|
|
175
|
-
return J(
|
|
176
|
-
l,
|
|
177
|
-
{ ref: U }
|
|
178
|
-
);
|
|
179
|
-
const Re = J(
|
|
180
|
-
l,
|
|
181
|
-
{
|
|
182
|
-
"aria-describedby": fe,
|
|
183
|
-
className: [t.className, "nk-tooltip__trigger", ne].filter(Boolean).join(" "),
|
|
184
|
-
onBlur: Te,
|
|
185
|
-
onFocus: pe,
|
|
186
|
-
onMouseEnter: we,
|
|
187
|
-
onMouseLeave: De,
|
|
188
|
-
onPointerDown: Ie,
|
|
189
|
-
ref: U,
|
|
190
|
-
style: { ...t.style, ...oe }
|
|
191
|
-
}
|
|
192
|
-
);
|
|
193
|
-
return /* @__PURE__ */ q(he, { children: [
|
|
194
|
-
Re,
|
|
195
|
-
R.present && V ? /* @__PURE__ */ C(
|
|
196
|
-
Ne,
|
|
197
|
-
{
|
|
198
|
-
container: L,
|
|
199
|
-
inheritFrom: I,
|
|
200
|
-
children: /* @__PURE__ */ q(
|
|
201
|
-
ke,
|
|
202
|
-
{
|
|
203
|
-
ref: de,
|
|
204
|
-
"aria-hidden": x ? void 0 : !0,
|
|
205
|
-
className: ["nk-tooltip", te].filter(Boolean).join(" "),
|
|
206
|
-
"data-placement": (m == null ? void 0 : m.placement) ?? B,
|
|
207
|
-
"data-state": R.state === "closing" ? "closing" : "open",
|
|
208
|
-
id: Y,
|
|
209
|
-
onMouseEnter: Ee,
|
|
210
|
-
onMouseLeave: ge,
|
|
211
|
-
role: "tooltip",
|
|
212
|
-
style: m ? {
|
|
213
|
-
...S,
|
|
214
|
-
"--nk-tooltip-arrow-offset": `${m.arrowOffset}px`,
|
|
215
|
-
left: m.left,
|
|
216
|
-
top: m.top,
|
|
217
|
-
zIndex: A.zIndex
|
|
218
|
-
} : {
|
|
219
|
-
...S,
|
|
220
|
-
visibility: "hidden",
|
|
221
|
-
zIndex: A.zIndex
|
|
222
|
-
},
|
|
223
|
-
children: [
|
|
224
|
-
/* @__PURE__ */ C("span", { "aria-hidden": "true", className: "nk-tooltip__arrow" }),
|
|
225
|
-
p
|
|
226
|
-
]
|
|
227
|
-
}
|
|
228
|
-
)
|
|
229
|
-
}
|
|
230
|
-
) : null
|
|
231
|
-
] });
|
|
232
|
-
});
|
|
233
|
-
export {
|
|
234
|
-
Ge as T,
|
|
235
|
-
Je as a
|
|
236
|
-
};
|
package/dist/aria-DHnOMyYp.js
DELETED
package/dist/aria-DKxpE8cA.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";function n(e){return e!==void 0&&e!==!1&&e!=="false"}function r(e,t){return e?!0:t}exports.hasInvalidState=n;exports.resolveAriaInvalid=r;
|