neatkit 0.9.0 → 0.11.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/Boundary.cjs +1 -1
- package/dist/Boundary.js +191 -120
- package/dist/{Button-DU4j_IED.cjs → Button-DtrX4X-s.cjs} +1 -1
- package/dist/{Button-BV5OUXpc.js → Button-LmEHdRkW.js} +2 -2
- package/dist/Button.cjs +1 -1
- package/dist/Button.js +1 -1
- package/dist/Checkbox.cjs +1 -1
- package/dist/Checkbox.js +112 -111
- package/dist/Field.cjs +1 -1
- package/dist/Field.js +57 -62
- package/dist/Icon-CMSHMSDJ.cjs +1 -0
- package/dist/{Icon-CxK1wlGk.js → Icon-NT3kRJYz.js} +275 -94
- package/dist/Icon.cjs +1 -1
- package/dist/Icon.js +1 -1
- package/dist/Input.cjs +1 -1
- package/dist/Input.js +53 -52
- package/dist/Markdown.cjs +1 -1
- package/dist/Markdown.js +1 -1
- package/dist/Modal.cjs +1 -1
- package/dist/Modal.js +58 -57
- package/dist/PinInput.cjs +1 -1
- package/dist/PinInput.js +89 -88
- package/dist/Popover.cjs +1 -1
- package/dist/Popover.js +117 -119
- package/dist/Progress.cjs +1 -0
- package/dist/Progress.js +40 -0
- package/dist/Radio.cjs +1 -1
- package/dist/Radio.js +48 -47
- package/dist/Select.cjs +1 -1
- package/dist/Select.js +364 -359
- package/dist/Sidebar.cjs +1 -1
- package/dist/Sidebar.js +381 -332
- package/dist/Spinner-BE0F4y2S.cjs +1 -0
- package/dist/Spinner-CmxlDlOk.js +23 -0
- package/dist/Spinner.cjs +1 -1
- package/dist/Spinner.js +1 -1
- package/dist/Switch.cjs +1 -1
- package/dist/Switch.js +1 -1
- package/dist/{Table-qetwZpTC.cjs → Table-Bjw9lUKS.cjs} +1 -1
- package/dist/{Table-CADupJEU.js → Table-GeoE4h-u.js} +2 -2
- 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-CpyROf6x.js +225 -0
- package/dist/Tooltip-DDPh_YFO.cjs +1 -0
- package/dist/Tooltip.cjs +1 -1
- package/dist/Tooltip.js +1 -1
- package/dist/aria-Bv-xVREf.js +17 -0
- package/dist/aria-DM-xYEHQ.cjs +1 -0
- package/dist/components/Boundary/hooks/useDocumentBackground.d.ts +28 -0
- package/dist/components/Icon/icons/AppleIcon.d.ts +11 -0
- package/dist/components/Icon/icons/BingIcon.d.ts +11 -0
- package/dist/components/Icon/icons/FacebookIcon.d.ts +11 -0
- package/dist/components/Icon/icons/GoogleIcon.d.ts +11 -0
- package/dist/components/Icon/icons/InstagramIcon.d.ts +11 -0
- package/dist/components/Icon/icons/MicrosoftIcon.d.ts +11 -0
- package/dist/components/Icon/icons/TwitterIcon.d.ts +11 -0
- package/dist/components/Icon/utils/registry.d.ts +7 -0
- package/dist/components/PinInput/PinInput.d.ts +1 -1
- package/dist/components/Portal/hooks/useAnchoredPosition.d.ts +59 -0
- package/dist/components/Progress/Progress.d.ts +38 -0
- package/dist/components/Progress/index.d.ts +2 -0
- package/dist/components/Progress/utils/value.d.ts +25 -0
- package/dist/components/Radio/Radio.d.ts +1 -1
- package/dist/components/Select/Select.d.ts +6 -74
- package/dist/components/Select/components/CustomSelect.d.ts +59 -0
- package/dist/components/Select/components/NativeSelect.d.ts +26 -0
- package/dist/components/Select/components/SelectListbox.d.ts +50 -0
- package/dist/components/Select/hooks/useSelectFormReset.d.ts +27 -0
- package/dist/components/Select/hooks/useSelectPosition.d.ts +12 -0
- package/dist/components/Select/hooks/useTypeahead.d.ts +14 -0
- package/dist/components/Select/utils/options.d.ts +38 -0
- package/dist/components/Sidebar/Sidebar.d.ts +30 -24
- package/dist/components/Sidebar/components/SidebarFallbackTrigger.d.ts +32 -0
- package/dist/components/Sidebar/components/SidebarOverlay.d.ts +3 -4
- package/dist/components/Sidebar/components/SidebarPanel.d.ts +3 -3
- package/dist/components/Sidebar/components/SidebarTrigger.d.ts +4 -0
- package/dist/effects-D98vUn6N.cjs +1 -0
- package/dist/effects-DGbA6Q2O.js +18 -0
- package/dist/style.css +1 -1
- package/dist/useAnchoredPosition-C0VS7hm6.js +105 -0
- package/dist/useAnchoredPosition-D7GRFzoX.cjs +1 -0
- package/dist/useFloatingPosition-DQgw-w_Z.cjs +1 -0
- package/dist/useFloatingPosition-MGoyautY.js +57 -0
- package/dist/useFocusTrap-BxPazAL6.js +136 -0
- package/dist/useFocusTrap-CrMcAu8s.cjs +1 -0
- package/dist/{usePresence-CqegYqy4.js → usePresence-BTRY1_l-.js} +47 -56
- package/dist/usePresence-Dm0mls5p.cjs +1 -0
- package/dist/utils/aria.d.ts +4 -5
- package/dist/utils/trigger.d.ts +46 -0
- package/package.json +6 -1
- package/dist/Icon-BIBzgznI.cjs +0 -1
- package/dist/Spinner-BXgw60UC.cjs +0 -1
- package/dist/Spinner-CVYvk6YK.js +0 -25
- package/dist/Tooltip-B2d5ss7S.cjs +0 -1
- package/dist/Tooltip-BK64rkxV.js +0 -231
- package/dist/aria-Bntn6ad_.cjs +0 -1
- package/dist/aria-CeA9QfD1.js +0 -15
- package/dist/effects-D5CWf-Pl.js +0 -8
- package/dist/effects-D85L_7zM.cjs +0 -1
- package/dist/floating-position-DIjh2wnP.cjs +0 -1
- package/dist/floating-position-DvR6e334.js +0 -50
- package/dist/useFloatingPosition-B3ZC-v3v.js +0 -43
- package/dist/useFloatingPosition-GzkP9dCc.cjs +0 -1
- package/dist/useFocusTrap-BrFZdMqQ.cjs +0 -1
- package/dist/useFocusTrap-DhVnlboe.js +0 -136
- package/dist/usePresence-B5RYv4e1.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const l=require("react/jsx-runtime"),p=require("react"),u=p.forwardRef(function(r,i){const{className:o="",color:n,size:e,style:t,...a}=r,s=typeof e=="number"?`${e}px`:e,c={...t,...s===void 0?void 0:{"--nk-spinner-size":s},...n?{color:n}:void 0};return l.jsx("div",{ref:i,className:["nk-spinner",o].filter(Boolean).join(" "),style:c,role:"status","aria-label":"Loading",...a})});exports.Spinner=u;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as c } from "react";
|
|
3
|
+
const S = c(function(r, s) {
|
|
4
|
+
const { className: i = "", color: n, size: e, style: t, ...a } = r, o = typeof e == "number" ? `${e}px` : e, l = {
|
|
5
|
+
...t,
|
|
6
|
+
...o === void 0 ? void 0 : { "--nk-spinner-size": o },
|
|
7
|
+
...n ? { color: n } : void 0
|
|
8
|
+
};
|
|
9
|
+
return /* @__PURE__ */ p(
|
|
10
|
+
"div",
|
|
11
|
+
{
|
|
12
|
+
ref: s,
|
|
13
|
+
className: ["nk-spinner", i].filter(Boolean).join(" "),
|
|
14
|
+
style: l,
|
|
15
|
+
role: "status",
|
|
16
|
+
"aria-label": "Loading",
|
|
17
|
+
...a
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
});
|
|
21
|
+
export {
|
|
22
|
+
S
|
|
23
|
+
};
|
package/dist/Spinner.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Spinner-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Spinner-BE0F4y2S.cjs");exports.default=e.Spinner;
|
package/dist/Spinner.js
CHANGED
package/dist/Switch.cjs
CHANGED
|
@@ -1 +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-
|
|
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-DM-xYEHQ.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
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";const a=require("react/jsx-runtime"),o=require("react"),A=require("./reference-C2guRuR0.cjs"),I=require("./Button-
|
|
1
|
+
"use client";"use strict";const a=require("react/jsx-runtime"),o=require("react"),A=require("./reference-C2guRuR0.cjs"),I=require("./Button-DtrX4X-s.cjs"),H=require("./Tooltip-DDPh_YFO.cjs"),v=o.createContext("body"),R=o.forwardRef(function(r,e){const{align:t="left",children:s,className:i,scope:c="col",sticky:b=!1,...d}=r;return a.jsx("th",{...d,ref:e,className:["nk-table__header-cell",i].filter(Boolean).join(" "),"data-align":t,"data-sticky":b||void 0,scope:c,children:s})});function w(n){for(const r of o.Children.toArray(n)){if(o.isValidElement(r)&&r.type===o.Fragment){if(w(r.props.children))return!0;continue}return!0}return!1}const D=o.forwardRef(function(r,e){const{children:t,className:s,emptyColumnCount:i=1,emptyMessage:c,...b}=r,d=!w(t),m=Number.isFinite(i)?Math.max(1,Math.floor(i)):1;return a.jsx("tbody",{...b,ref:e,className:["nk-table__body",s].filter(Boolean).join(" "),children:d&&c!==void 0?a.jsx("tr",{className:"nk-table__row",children:a.jsx("td",{className:"nk-table__cell nk-table__empty-cell",colSpan:m,children:a.jsx("div",{className:"nk-table__empty-content",children:c})})}):a.jsx(v.Provider,{value:"body",children:t})})});function K(n,r,e){return n===void 0?r:e?e(n):n instanceof Date?Number.isNaN(n.getTime())?"Invalid Date":n.toISOString().slice(0,10):typeof n=="boolean"?n?"Yes":"No":n}function O(n){if(typeof n=="number"||typeof n=="string")return String(n)}const S=o.forwardRef(function(r,e){const{align:t="left",children:s,className:i,format:c,title:b,truncate:d,value:m,...p}=r,{rowTrigger:l,...u}=p,k=K(m,s,c),f=d===void 0?void 0:{maxWidth:d},g=b??(d===void 0?void 0:O(k));return a.jsxs("td",{...u,ref:e,className:["nk-table__cell",i].filter(Boolean).join(" "),"data-align":t,title:g,children:[(l==null?void 0:l.kind)==="link"&&l.linkProperties?a.jsx("a",{ref:l.reference,"aria-label":l.ariaLabel,className:"nk-table__row-trigger",download:l.linkProperties.download,href:l.linkProperties.href,hrefLang:l.linkProperties.hrefLang,onClick:l.linkProperties.onNavigate,rel:l.linkProperties.rel,target:l.linkProperties.target}):null,(l==null?void 0:l.kind)==="button"?a.jsx("button",{ref:l.reference,"aria-label":l.ariaLabel,className:"nk-table__row-trigger",onClick:l.onClick,type:"button"}):null,d!==void 0?a.jsx("span",{className:"nk-table__truncated-content",style:f,children:k}):k]})}),F=o.forwardRef(function(r,e){const{children:t,className:s,...i}=r;return a.jsx("tfoot",{...i,ref:e,className:["nk-table__foot",s].filter(Boolean).join(" "),children:a.jsx(v.Provider,{value:"foot",children:t})})}),q=o.forwardRef(function(r,e){const{children:t,className:s,...i}=r;return a.jsx("thead",{...i,ref:e,className:["nk-table__head",s].filter(Boolean).join(" "),children:a.jsx(v.Provider,{value:"head",children:t})})}),z=["a[href]","audio[controls]","button","iframe","input","label","select","summary","textarea","video[controls]","[contenteditable]:not([contenteditable='false'])"].join(","),V=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 M(n,r){var t;let e=n;for(;e&&e!==r;){if(e.matches(z)||(((t=e.getAttribute("role"))==null?void 0:t.split(/\s+/))??[]).some(i=>V.has(i)))return!0;e=e.parentElement}return!1}function Y(n,r){let e=!1;function t(i){return o.Children.map(i,c=>o.isValidElement(c)?c.type===o.Fragment?o.cloneElement(c,void 0,t(c.props.children)):!e&&c.type===S?(e=!0,o.cloneElement(c,{rowTrigger:r})):c:c)}const s=t(n);return{attached:e,content:s}}function X(n){const{"aria-label":r,icon:e,label:t,...s}=n;return a.jsx(H.Tooltip2,{content:t,children:a.jsx(I.Button,{...s,"aria-label":r??t,className:"nk-table__action",icon:e,shape:"rectangle",type:"button",variant:"ghost"})})}function $(n){const{actions:r}=n;function e(t){t.stopPropagation()}return a.jsx("td",{className:"nk-table__cell nk-table__action-cell","data-align":"right",onClick:e,children:r.length>0?a.jsx("span",{className:"nk-table__action-list",children:r.map(t=>o.createElement(X,{...t,key:t.label}))}):null})}const G=o.forwardRef(function(r,e){const{children:t,className:s,...i}=r;return a.jsx(R,{...i,ref:e,align:"right",className:["nk-table__action-header-cell",s].filter(Boolean).join(" "),children:t??a.jsx("span",{className:"nk-table__visually-hidden",children:"Row actions"})})}),J=o.forwardRef(function(r,e){const{"aria-label":t,actions:s,children:i,className:c,download:b,href:d,hrefLang:m,onClick:p,onNavigate:l,rel:u,target:k,...f}=r,g=o.useRef(null),P=o.useContext(v),x=d!==void 0||p!==void 0,T=(t==null?void 0:t.trim())||(d!==void 0?"Open row":"Activate row");function N(h){g.current=h}let C;d!==void 0?C={ariaLabel:T,kind:"link",linkProperties:{download:b,href:d,hrefLang:m,onNavigate:l,rel:u,target:k},reference:N}:p!==void 0&&(C={ariaLabel:T,kind:"button",onClick:p,reference:N});const E=C?Y(i,C):{content:i};function B(h){if(h.defaultPrevented)return;const j=h.target;if(!(j instanceof Element)||M(j,h.currentTarget))return;const _=g.current;if(!_)return;const y=_.ownerDocument.defaultView;if(!y){_.click();return}_.dispatchEvent(new y.MouseEvent("click",{altKey:h.altKey,bubbles:!0,button:h.button,buttons:h.buttons,cancelable:!0,clientX:h.clientX,clientY:h.clientY,ctrlKey:h.ctrlKey,metaKey:h.metaKey,shiftKey:h.shiftKey}))}const L=P==="head"?a.jsx(G,{}):a.jsx($,{actions:s??[]});return a.jsxs("tr",{...f,ref:e,"aria-label":x?void 0:t,className:["nk-table__row",c].filter(Boolean).join(" "),"data-interactive":x||void 0,onClick:x?B:void 0,children:[E.content,L]})});function Q(){const n=o.useRef(null),r=o.useRef(null),[e,t]=o.useState(!1),[s,i]=o.useState(!1);o.useEffect(()=>{const b=n.current,d=r.current;if(!b||!d)return;const m=b,p=d;function l(){const g=m.scrollWidth>m.clientWidth;t(g),g||i(!1)}l();const u=m.ownerDocument.defaultView;u==null||u.addEventListener("resize",l);const k=u==null?void 0:u.ResizeObserver,f=k?new k(l):void 0;return f==null||f.observe(m),f==null||f.observe(p),()=>{u==null||u.removeEventListener("resize",l),f==null||f.disconnect()}},[]);function c(b){i(e&&b.currentTarget.scrollLeft>1)}return{containerReference:n,contentReference:r,isScrollable:e,isScrolled:s,handleScroll:c}}const U=o.forwardRef(function(r,e){const{"aria-label":t,children:s,className:i,containerClassName:c,...b}=r,{containerReference:d,contentReference:m,isScrollable:p,isScrolled:l,handleScroll:u}=Q(),k=t?`${t} scroll area`:"Scrollable table",f=o.useCallback(g=>{m.current=g,A.assignElementReference(e,g)},[m,e]);return a.jsx("div",{ref:d,"aria-label":p?k:void 0,className:["nk-table",c].filter(Boolean).join(" "),"data-scrolled":l||void 0,onScroll:u,role:p?"region":void 0,tabIndex:p?0:void 0,children:a.jsx("table",{...b,ref:f,"aria-label":t,className:["nk-table__element",i].filter(Boolean).join(" "),children:s})})}),W=Object.assign(U,{Body:D,Cell:S,Foot:F,HeaderCell:R,Head:q,Row:J});exports.Table=W;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { jsx as a, jsxs as E } from "react/jsx-runtime";
|
|
3
3
|
import { createContext as z, forwardRef as g, Children as B, isValidElement as L, Fragment as j, cloneElement as w, createElement as M, useRef as N, useContext as V, useState as x, useEffect as Y, useCallback as X } from "react";
|
|
4
4
|
import { a as $ } from "./reference-CXMr27nM.js";
|
|
5
|
-
import { B as q } from "./Button-
|
|
6
|
-
import { T as G } from "./Tooltip-
|
|
5
|
+
import { B as q } from "./Button-LmEHdRkW.js";
|
|
6
|
+
import { T as G } from "./Tooltip-CpyROf6x.js";
|
|
7
7
|
const v = z("body"), A = g(function(l, e) {
|
|
8
8
|
const {
|
|
9
9
|
align: t = "left",
|
package/dist/Table.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Table-
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Table-Bjw9lUKS.cjs");exports.default=e.Table;
|
package/dist/Table.js
CHANGED
package/dist/TextArea.cjs
CHANGED
|
@@ -1 +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-
|
|
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-DM-xYEHQ.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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as u } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as p } from "react";
|
|
3
|
-
import { h as R, r as A } from "./aria-
|
|
3
|
+
import { h as R, r as A } from "./aria-Bv-xVREf.js";
|
|
4
4
|
function o(a) {
|
|
5
5
|
return Number.isFinite(a) ? Math.max(1, Math.floor(a)) : 1;
|
|
6
6
|
}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as V, jsxs as q, Fragment as De } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo as X, createContext as Ie, forwardRef as he, Fragment as ve, useId as Pe, useContext as Le, useRef as o, useState as N, useCallback as c, useEffect as G, cloneElement as J } from "react";
|
|
4
|
+
import { m as Fe } from "./aria-Bv-xVREf.js";
|
|
5
|
+
import { g as Oe, a as K } from "./reference-CXMr27nM.js";
|
|
6
|
+
import { u as _e, r as Me } from "./useFloatingPosition-MGoyautY.js";
|
|
7
|
+
import { u as xe } from "./effects-DGbA6Q2O.js";
|
|
8
|
+
import { b as We, c as ke, d as Be, P as Ne } from "./usePresence-BTRY1_l-.js";
|
|
9
|
+
import { i as Ve } from "./focus-restoration-BvNZzrQA.js";
|
|
10
|
+
import { S as Ae } from "./Surface-vEFsZC12.js";
|
|
11
|
+
const Ce = 500, Z = Ie(null);
|
|
12
|
+
function je(s) {
|
|
13
|
+
const { children: p, delay: u = Ce } = s, i = X(() => ({
|
|
14
|
+
delay: u
|
|
15
|
+
}), [u]);
|
|
16
|
+
return /* @__PURE__ */ V(Z.Provider, { value: i, children: p });
|
|
17
|
+
}
|
|
18
|
+
const ee = 500, Q = 100;
|
|
19
|
+
function ze(s, p, u, i) {
|
|
20
|
+
p.current = s, K(u, s), K(i, s);
|
|
21
|
+
}
|
|
22
|
+
function Se(s) {
|
|
23
|
+
return Number.isFinite(s) ? Math.max(0, s) : ee;
|
|
24
|
+
}
|
|
25
|
+
const Ye = he(function(p, u) {
|
|
26
|
+
const {
|
|
27
|
+
children: i,
|
|
28
|
+
className: re,
|
|
29
|
+
content: m,
|
|
30
|
+
contentClassName: ne,
|
|
31
|
+
contentStyle: A,
|
|
32
|
+
delay: te,
|
|
33
|
+
disabled: T = !1,
|
|
34
|
+
onOpenChange: R,
|
|
35
|
+
placement: C = "top",
|
|
36
|
+
style: oe
|
|
37
|
+
} = p;
|
|
38
|
+
if (m == null || typeof m == "boolean" || typeof m == "string" && !m.trim())
|
|
39
|
+
throw new Error("Tooltip content must not be empty");
|
|
40
|
+
if (i.type === ve)
|
|
41
|
+
throw new Error("Tooltip requires a single non-Fragment trigger");
|
|
42
|
+
const j = `${Pe()}-tooltip`, F = Le(Z), O = i.props, z = Oe(i), g = o(null), _ = o(null), S = o(T), M = o(!1), D = o(null), I = o(null), h = o(null), v = o(!1), w = o(!1), y = o(!1), l = o(!1), [P, se] = N(null), [ie, ce] = N(null), [L, ue] = N(!1);
|
|
43
|
+
S.current = T;
|
|
44
|
+
const x = Se(
|
|
45
|
+
te ?? (F == null ? void 0 : F.delay) ?? ee
|
|
46
|
+
), b = We(L), Y = (P == null ? void 0 : P.ownerDocument) ?? (typeof document > "u" ? null : document), W = xe("Tooltip").boundaryElement, k = ke(b.present, W), a = _e(
|
|
47
|
+
b.present,
|
|
48
|
+
C,
|
|
49
|
+
P,
|
|
50
|
+
ie,
|
|
51
|
+
W
|
|
52
|
+
), le = X(
|
|
53
|
+
() => [g, _],
|
|
54
|
+
[]
|
|
55
|
+
), ae = Fe(
|
|
56
|
+
O["aria-describedby"],
|
|
57
|
+
j
|
|
58
|
+
), fe = L && b.present ? ae : O["aria-describedby"], $ = c(
|
|
59
|
+
(e) => {
|
|
60
|
+
ze(
|
|
61
|
+
e,
|
|
62
|
+
g,
|
|
63
|
+
z,
|
|
64
|
+
u
|
|
65
|
+
), se(e);
|
|
66
|
+
},
|
|
67
|
+
[u, z]
|
|
68
|
+
), de = c(
|
|
69
|
+
(e) => {
|
|
70
|
+
_.current = e, e || (l.current = !1), ce(e);
|
|
71
|
+
},
|
|
72
|
+
[]
|
|
73
|
+
), n = c(() => {
|
|
74
|
+
const e = D.current;
|
|
75
|
+
e && e.ownerWindow.clearTimeout(e.timerId), D.current = null;
|
|
76
|
+
}, []), t = c(() => {
|
|
77
|
+
const e = I.current;
|
|
78
|
+
e && e.ownerWindow.clearTimeout(e.timerId), I.current = null;
|
|
79
|
+
}, []), E = c(() => {
|
|
80
|
+
const e = h.current;
|
|
81
|
+
e && e.ownerWindow.clearTimeout(e.timerId), h.current = null;
|
|
82
|
+
}, []), r = c((e) => {
|
|
83
|
+
M.current !== e && (e || (l.current = !1), M.current = e, ue(e), R == null || R(e));
|
|
84
|
+
}, [R]), B = c((e) => {
|
|
85
|
+
var H, U;
|
|
86
|
+
if (t(), w.current || y.current || l.current)
|
|
87
|
+
return;
|
|
88
|
+
if (e === 0) {
|
|
89
|
+
r(!1);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const f = ((H = g.current) == null ? void 0 : H.ownerDocument.defaultView) ?? ((U = _.current) == null ? void 0 : U.ownerDocument.defaultView);
|
|
93
|
+
if (!f) {
|
|
94
|
+
r(!1);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
const d = f.setTimeout(() => {
|
|
98
|
+
I.current = null, !w.current && !y.current && !l.current && r(!1);
|
|
99
|
+
}, e);
|
|
100
|
+
I.current = {
|
|
101
|
+
ownerWindow: f,
|
|
102
|
+
timerId: d
|
|
103
|
+
};
|
|
104
|
+
}, [t, r]), me = c(() => {
|
|
105
|
+
var d;
|
|
106
|
+
if (n(), t(), x === 0) {
|
|
107
|
+
r(!0);
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
const e = (d = g.current) == null ? void 0 : d.ownerDocument.defaultView;
|
|
111
|
+
if (!e) return;
|
|
112
|
+
const f = e.setTimeout(() => {
|
|
113
|
+
D.current = null, S.current || r(!0);
|
|
114
|
+
}, x);
|
|
115
|
+
D.current = { ownerWindow: e, timerId: f };
|
|
116
|
+
}, [t, n, x, r]);
|
|
117
|
+
function pe(e) {
|
|
118
|
+
if (w.current = !0, t(), v.current || Ve(e.currentTarget)) {
|
|
119
|
+
n();
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
n(), r(!0);
|
|
123
|
+
}
|
|
124
|
+
function Te(e) {
|
|
125
|
+
e.currentTarget.contains(e.relatedTarget) || (w.current = !1, n(), B(0));
|
|
126
|
+
}
|
|
127
|
+
function ge() {
|
|
128
|
+
y.current = !0, me();
|
|
129
|
+
}
|
|
130
|
+
function we() {
|
|
131
|
+
y.current = !1, n(), B(Q);
|
|
132
|
+
}
|
|
133
|
+
function ye() {
|
|
134
|
+
l.current = !0, t();
|
|
135
|
+
}
|
|
136
|
+
function be() {
|
|
137
|
+
l.current = !1, B(Q);
|
|
138
|
+
}
|
|
139
|
+
function Ee() {
|
|
140
|
+
var d;
|
|
141
|
+
n(), t(), r(!1);
|
|
142
|
+
const e = (d = g.current) == null ? void 0 : d.ownerDocument.defaultView;
|
|
143
|
+
if (!e) return;
|
|
144
|
+
v.current = !0, E();
|
|
145
|
+
const f = e.setTimeout(() => {
|
|
146
|
+
v.current = !1, h.current = null;
|
|
147
|
+
}, 0);
|
|
148
|
+
h.current = { ownerWindow: e, timerId: f };
|
|
149
|
+
}
|
|
150
|
+
if (Be({
|
|
151
|
+
boundary: W,
|
|
152
|
+
active: L,
|
|
153
|
+
boundaries: le,
|
|
154
|
+
dismissOnPointerDownOutside: !0,
|
|
155
|
+
layerId: k.id,
|
|
156
|
+
onEscapeDismiss: () => r(!1),
|
|
157
|
+
onPointerDownOutsideDismiss: () => r(!1),
|
|
158
|
+
ownerDocument: Y
|
|
159
|
+
}), G(() => {
|
|
160
|
+
T && (n(), t(), E(), v.current = !1, w.current = !1, y.current = !1, l.current = !1, M.current && r(!1));
|
|
161
|
+
}, [
|
|
162
|
+
t,
|
|
163
|
+
n,
|
|
164
|
+
E,
|
|
165
|
+
T,
|
|
166
|
+
r
|
|
167
|
+
]), G(() => () => {
|
|
168
|
+
n(), t(), E();
|
|
169
|
+
}, [t, n, E]), T)
|
|
170
|
+
return J(
|
|
171
|
+
i,
|
|
172
|
+
{ ref: $ }
|
|
173
|
+
);
|
|
174
|
+
const Re = J(
|
|
175
|
+
i,
|
|
176
|
+
Me(O, {
|
|
177
|
+
"aria-describedby": fe,
|
|
178
|
+
className: ["nk-tooltip__trigger", re].filter(Boolean).join(" "),
|
|
179
|
+
onBlur: Te,
|
|
180
|
+
onFocus: pe,
|
|
181
|
+
onMouseEnter: ge,
|
|
182
|
+
onMouseLeave: we,
|
|
183
|
+
onPointerDown: Ee,
|
|
184
|
+
ref: $,
|
|
185
|
+
style: oe
|
|
186
|
+
})
|
|
187
|
+
);
|
|
188
|
+
return /* @__PURE__ */ q(De, { children: [
|
|
189
|
+
Re,
|
|
190
|
+
b.present && Y ? /* @__PURE__ */ V(Ne, { children: /* @__PURE__ */ q(
|
|
191
|
+
Ae,
|
|
192
|
+
{
|
|
193
|
+
ref: de,
|
|
194
|
+
"aria-hidden": L ? void 0 : !0,
|
|
195
|
+
className: ["nk-tooltip", ne].filter(Boolean).join(" "),
|
|
196
|
+
"data-placement": (a == null ? void 0 : a.placement) ?? C,
|
|
197
|
+
"data-state": b.state === "closing" ? "closing" : "open",
|
|
198
|
+
id: j,
|
|
199
|
+
onMouseEnter: ye,
|
|
200
|
+
onMouseLeave: be,
|
|
201
|
+
role: "tooltip",
|
|
202
|
+
style: a ? {
|
|
203
|
+
...A,
|
|
204
|
+
"--nk-tooltip-arrow-offset": `${a.arrowOffset}px`,
|
|
205
|
+
left: a.left,
|
|
206
|
+
top: a.top,
|
|
207
|
+
zIndex: k.zIndex
|
|
208
|
+
} : {
|
|
209
|
+
...A,
|
|
210
|
+
visibility: "hidden",
|
|
211
|
+
zIndex: k.zIndex
|
|
212
|
+
},
|
|
213
|
+
children: [
|
|
214
|
+
/* @__PURE__ */ V("span", { "aria-hidden": "true", className: "nk-tooltip__arrow" }),
|
|
215
|
+
m
|
|
216
|
+
]
|
|
217
|
+
}
|
|
218
|
+
) }) : null
|
|
219
|
+
] });
|
|
220
|
+
}), er = Object.assign(Ye, {
|
|
221
|
+
Provider: je
|
|
222
|
+
});
|
|
223
|
+
export {
|
|
224
|
+
er as T
|
|
225
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";const m=require("react/jsx-runtime"),n=require("react"),we=require("./aria-DM-xYEHQ.cjs"),W=require("./reference-C2guRuR0.cjs"),$=require("./useFloatingPosition-DQgw-w_Z.cjs"),be=require("./effects-D98vUn6N.cjs"),F=require("./usePresence-Dm0mls5p.cjs"),Ee=require("./focus-restoration-70WcQRr5.cjs"),ye=require("./Surface-BttJYSDt.cjs"),De=500,J=n.createContext(null);function Ie(s){const{children:p,delay:i=De}=s,c=n.useMemo(()=>({delay:i}),[i]);return m.jsx(J.Provider,{value:c,children:p})}const K=500,G=100;function he(s,p,i,c){p.current=s,W.assignElementReference(i,s),W.assignElementReference(c,s)}function ve(s){return Number.isFinite(s)?Math.max(0,s):K}const Pe=n.forwardRef(function(p,i){const{children:c,className:Q,content:d,contentClassName:X,contentStyle:B,delay:Z,disabled:T=!1,onOpenChange:y,placement:N="top",style:ee}=p;if(d==null||typeof d=="boolean"||typeof d=="string"&&!d.trim())throw new Error("Tooltip content must not be empty");if(c.type===n.Fragment)throw new Error("Tooltip requires a single non-Fragment trigger");const S=`${n.useId()}-tooltip`,k=n.useContext(J),O=c.props,V=W.getElementReference(c),g=n.useRef(null),C=n.useRef(null),A=n.useRef(T),_=n.useRef(!1),D=n.useRef(null),I=n.useRef(null),h=n.useRef(null),v=n.useRef(!1),R=n.useRef(!1),w=n.useRef(!1),u=n.useRef(!1),[P,ne]=n.useState(null),[re,te]=n.useState(null),[L,oe]=n.useState(!1);A.current=T;const x=ve(Z??(k==null?void 0:k.delay)??K),b=F.usePresence(L),z=(P==null?void 0:P.ownerDocument)??(typeof document>"u"?null:document),M=be.useBoundary("Tooltip").boundaryElement,q=F.useOverlayLayer(b.present,M),l=$.useFloatingPosition(b.present,N,P,re,M),se=n.useMemo(()=>[g,C],[]),ce=we.mergeIdentifiers(O["aria-describedby"],S),ie=L&&b.present?ce:O["aria-describedby"],Y=n.useCallback(e=>{he(e,g,V,i),ne(e)},[i,V]),ue=n.useCallback(e=>{C.current=e,e||(u.current=!1),te(e)},[]),t=n.useCallback(()=>{const e=D.current;e&&e.ownerWindow.clearTimeout(e.timerId),D.current=null},[]),o=n.useCallback(()=>{const e=I.current;e&&e.ownerWindow.clearTimeout(e.timerId),I.current=null},[]),E=n.useCallback(()=>{const e=h.current;e&&e.ownerWindow.clearTimeout(e.timerId),h.current=null},[]),r=n.useCallback(e=>{_.current!==e&&(e||(u.current=!1),_.current=e,oe(e),y==null||y(e))},[y]),j=n.useCallback(e=>{var H,U;if(o(),R.current||w.current||u.current)return;if(e===0){r(!1);return}const a=((H=g.current)==null?void 0:H.ownerDocument.defaultView)??((U=C.current)==null?void 0:U.ownerDocument.defaultView);if(!a){r(!1);return}const f=a.setTimeout(()=>{I.current=null,!R.current&&!w.current&&!u.current&&r(!1)},e);I.current={ownerWindow:a,timerId:f}},[o,r]),le=n.useCallback(()=>{var f;if(t(),o(),x===0){r(!0);return}const e=(f=g.current)==null?void 0:f.ownerDocument.defaultView;if(!e)return;const a=e.setTimeout(()=>{D.current=null,A.current||r(!0)},x);D.current={ownerWindow:e,timerId:a}},[o,t,x,r]);function ae(e){if(R.current=!0,o(),v.current||Ee.isElementFocusRestoration(e.currentTarget)){t();return}t(),r(!0)}function fe(e){e.currentTarget.contains(e.relatedTarget)||(R.current=!1,t(),j(0))}function de(){w.current=!0,le()}function me(){w.current=!1,t(),j(G)}function pe(){u.current=!0,o()}function Te(){u.current=!1,j(G)}function ge(){var f;t(),o(),r(!1);const e=(f=g.current)==null?void 0:f.ownerDocument.defaultView;if(!e)return;v.current=!0,E();const a=e.setTimeout(()=>{v.current=!1,h.current=null},0);h.current={ownerWindow:e,timerId:a}}if(F.useDismissableLayer({boundary:M,active:L,boundaries:se,dismissOnPointerDownOutside:!0,layerId:q.id,onEscapeDismiss:()=>r(!1),onPointerDownOutsideDismiss:()=>r(!1),ownerDocument:z}),n.useEffect(()=>{T&&(t(),o(),E(),v.current=!1,R.current=!1,w.current=!1,u.current=!1,_.current&&r(!1))},[o,t,E,T,r]),n.useEffect(()=>()=>{t(),o(),E()},[o,t,E]),T)return n.cloneElement(c,{ref:Y});const Re=n.cloneElement(c,$.resolveTriggerOverrides(O,{"aria-describedby":ie,className:["nk-tooltip__trigger",Q].filter(Boolean).join(" "),onBlur:fe,onFocus:ae,onMouseEnter:de,onMouseLeave:me,onPointerDown:ge,ref:Y,style:ee}));return m.jsxs(m.Fragment,{children:[Re,b.present&&z?m.jsx(F.Portal,{children:m.jsxs(ye.Surface,{ref:ue,"aria-hidden":L?void 0:!0,className:["nk-tooltip",X].filter(Boolean).join(" "),"data-placement":(l==null?void 0:l.placement)??N,"data-state":b.state==="closing"?"closing":"open",id:S,onMouseEnter:pe,onMouseLeave:Te,role:"tooltip",style:l?{...B,"--nk-tooltip-arrow-offset":`${l.arrowOffset}px`,left:l.left,top:l.top,zIndex:q.zIndex}:{...B,visibility:"hidden",zIndex:q.zIndex},children:[m.jsx("span",{"aria-hidden":"true",className:"nk-tooltip__arrow"}),d]})}):null]})}),Le=Object.assign(Pe,{Provider:Ie});exports.Tooltip2=Le;
|
package/dist/Tooltip.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Tooltip-
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Tooltip-DDPh_YFO.cjs");exports.default=e.Tooltip2;
|
package/dist/Tooltip.js
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
function o(e) {
|
|
2
|
+
return e !== void 0 && e !== !1 && e !== "false";
|
|
3
|
+
}
|
|
4
|
+
function r(e, t) {
|
|
5
|
+
return e ? !0 : t;
|
|
6
|
+
}
|
|
7
|
+
function u(...e) {
|
|
8
|
+
const t = e.flatMap(
|
|
9
|
+
(n) => (n == null ? void 0 : n.split(/\s+/).filter(Boolean)) ?? []
|
|
10
|
+
), s = [...new Set(t)];
|
|
11
|
+
return s.length > 0 ? s.join(" ") : void 0;
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
o as h,
|
|
15
|
+
u as m,
|
|
16
|
+
r
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function r(e){return e!==void 0&&e!==!1&&e!=="false"}function o(e,t){return e?!0:t}function l(...e){const t=e.flatMap(n=>(n==null?void 0:n.split(/\s+/).filter(Boolean))??[]),s=[...new Set(t)];return s.length>0?s.join(" "):void 0}exports.hasInvalidState=r;exports.mergeIdentifiers=l;exports.resolveAriaInvalid=o;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { BoundaryWidthStore } from "../contexts/BoundaryContext";
|
|
2
|
+
/** A type representing what decides whether a Boundary paints a document. */
|
|
3
|
+
export type DocumentBackgroundOptions = {
|
|
4
|
+
/** Whether another Boundary encloses this one. */
|
|
5
|
+
nested: boolean;
|
|
6
|
+
/** The mounted Boundary root, once it has rendered. */
|
|
7
|
+
rootElement: HTMLElement | null;
|
|
8
|
+
/** The Boundary's width store, observed for resizes. */
|
|
9
|
+
width: BoundaryWidthStore;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Extends a Boundary's appearance across the whole document.
|
|
13
|
+
*
|
|
14
|
+
* A Boundary paints an element within the page rather than the page itself,
|
|
15
|
+
* so a viewer scrolling past the document's edge meets the browser's canvas
|
|
16
|
+
* instead, and a dark interface appears to sit on a white page.
|
|
17
|
+
*
|
|
18
|
+
* The page Boundary is recognized rather than configured: the one no other
|
|
19
|
+
* Boundary encloses, which also spans the viewport. Either test alone admits
|
|
20
|
+
* a Boundary that is not the page, so both must hold.
|
|
21
|
+
*
|
|
22
|
+
* @param options - The Boundary being resolved.
|
|
23
|
+
*
|
|
24
|
+
* @note A document adopts the appearance only once the Boundary has been
|
|
25
|
+
* measured, which a server render precedes entirely. A page needing the two to
|
|
26
|
+
* agree from its first paint declares the background in its own markup.
|
|
27
|
+
*/
|
|
28
|
+
export declare function useDocumentBackground(options: DocumentBackgroundOptions): void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IconGraphicProps } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Renders an Apple icon.
|
|
4
|
+
*
|
|
5
|
+
* @param props - The SVG properties applied to the icon.
|
|
6
|
+
* @param forwardedReference - The reference assigned to the rendered SVG.
|
|
7
|
+
*
|
|
8
|
+
* @returns The rendered icon SVG.
|
|
9
|
+
*/
|
|
10
|
+
declare const _default: import("react").ForwardRefExoticComponent<Omit<IconGraphicProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IconGraphicProps } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Renders a Bing icon.
|
|
4
|
+
*
|
|
5
|
+
* @param props - The SVG properties applied to the icon.
|
|
6
|
+
* @param forwardedReference - The reference assigned to the rendered SVG.
|
|
7
|
+
*
|
|
8
|
+
* @returns The rendered icon SVG.
|
|
9
|
+
*/
|
|
10
|
+
declare const _default: import("react").ForwardRefExoticComponent<Omit<IconGraphicProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IconGraphicProps } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Renders a Facebook icon.
|
|
4
|
+
*
|
|
5
|
+
* @param props - The SVG properties applied to the icon.
|
|
6
|
+
* @param forwardedReference - The reference assigned to the rendered SVG.
|
|
7
|
+
*
|
|
8
|
+
* @returns The rendered icon SVG.
|
|
9
|
+
*/
|
|
10
|
+
declare const _default: import("react").ForwardRefExoticComponent<Omit<IconGraphicProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IconGraphicProps } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Renders a Google icon.
|
|
4
|
+
*
|
|
5
|
+
* @param props - The SVG properties applied to the icon.
|
|
6
|
+
* @param forwardedReference - The reference assigned to the rendered SVG.
|
|
7
|
+
*
|
|
8
|
+
* @returns The rendered icon SVG.
|
|
9
|
+
*/
|
|
10
|
+
declare const _default: import("react").ForwardRefExoticComponent<Omit<IconGraphicProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IconGraphicProps } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Renders an Instagram icon.
|
|
4
|
+
*
|
|
5
|
+
* @param props - The SVG properties applied to the icon.
|
|
6
|
+
* @param forwardedReference - The reference assigned to the rendered SVG.
|
|
7
|
+
*
|
|
8
|
+
* @returns The rendered icon SVG.
|
|
9
|
+
*/
|
|
10
|
+
declare const _default: import("react").ForwardRefExoticComponent<Omit<IconGraphicProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IconGraphicProps } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Renders a Microsoft icon.
|
|
4
|
+
*
|
|
5
|
+
* @param props - The SVG properties applied to the icon.
|
|
6
|
+
* @param forwardedReference - The reference assigned to the rendered SVG.
|
|
7
|
+
*
|
|
8
|
+
* @returns The rendered icon SVG.
|
|
9
|
+
*/
|
|
10
|
+
declare const _default: import("react").ForwardRefExoticComponent<Omit<IconGraphicProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IconGraphicProps } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Renders a Twitter icon.
|
|
4
|
+
*
|
|
5
|
+
* @param props - The SVG properties applied to the icon.
|
|
6
|
+
* @param forwardedReference - The reference assigned to the rendered SVG.
|
|
7
|
+
*
|
|
8
|
+
* @returns The rendered icon SVG.
|
|
9
|
+
*/
|
|
10
|
+
declare const _default: import("react").ForwardRefExoticComponent<Omit<IconGraphicProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
11
|
+
export default _default;
|
|
@@ -6,6 +6,13 @@ export declare const iconGraphics: {
|
|
|
6
6
|
readonly mail: import("react").ForwardRefExoticComponent<Omit<import("../icons/types").IconGraphicProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
7
7
|
readonly github: import("react").ForwardRefExoticComponent<Omit<import("../icons/types").IconGraphicProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
8
8
|
readonly globe: import("react").ForwardRefExoticComponent<Omit<import("../icons/types").IconGraphicProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
9
|
+
readonly google: import("react").ForwardRefExoticComponent<Omit<import("../icons/types").IconGraphicProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
10
|
+
readonly microsoft: import("react").ForwardRefExoticComponent<Omit<import("../icons/types").IconGraphicProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
11
|
+
readonly bing: import("react").ForwardRefExoticComponent<Omit<import("../icons/types").IconGraphicProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
12
|
+
readonly apple: import("react").ForwardRefExoticComponent<Omit<import("../icons/types").IconGraphicProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
13
|
+
readonly twitter: import("react").ForwardRefExoticComponent<Omit<import("../icons/types").IconGraphicProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
14
|
+
readonly facebook: import("react").ForwardRefExoticComponent<Omit<import("../icons/types").IconGraphicProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
15
|
+
readonly instagram: import("react").ForwardRefExoticComponent<Omit<import("../icons/types").IconGraphicProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
9
16
|
readonly linkedin: import("react").ForwardRefExoticComponent<Omit<import("../icons/types").IconGraphicProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
10
17
|
readonly reddit: import("react").ForwardRefExoticComponent<Omit<import("../icons/types").IconGraphicProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
11
18
|
readonly exit: import("react").ForwardRefExoticComponent<Omit<import("../icons/types").IconGraphicProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
@@ -47,7 +47,7 @@ export type PinInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "childre
|
|
|
47
47
|
*
|
|
48
48
|
* @returns The rendered PinInput control.
|
|
49
49
|
*/
|
|
50
|
-
declare const PinInput: import("react").ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "defaultValue" | "className" | "style" | "inputMode" | "children" | "onPaste" | "onChange" | "size" | "
|
|
50
|
+
declare const PinInput: import("react").ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "defaultValue" | "className" | "style" | "inputMode" | "children" | "onPaste" | "onChange" | "size" | "value" | "pattern" | "type" | "maxLength" | "minLength"> & {
|
|
51
51
|
/** The additional class name applied to the composite PinInput root. */
|
|
52
52
|
className?: string;
|
|
53
53
|
/** Whether entered characters are visually replaced with centered dots. */
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { type EdgeBounds } from "../utils/floating-position";
|
|
2
|
+
/** A type representing the coordinates every fitted position carries. */
|
|
3
|
+
type PositionCoordinates = {
|
|
4
|
+
/** The horizontal position, in the coordinate space of its producer. */
|
|
5
|
+
left: number;
|
|
6
|
+
/** The vertical position, in the coordinate space of its producer. */
|
|
7
|
+
top: number;
|
|
8
|
+
};
|
|
9
|
+
/** A type representing the measurements one repositioning pass receives. */
|
|
10
|
+
export type AnchoredMeasurement = {
|
|
11
|
+
/** The bounds of the element the content is anchored to. */
|
|
12
|
+
triggerBounds: DOMRect;
|
|
13
|
+
/** The bounds of the positioned content, once it is mounted. */
|
|
14
|
+
panelBounds: DOMRect | undefined;
|
|
15
|
+
/** The visible bounds of the boundary the content stays inside. */
|
|
16
|
+
visibleBounds: EdgeBounds;
|
|
17
|
+
/**
|
|
18
|
+
* Reads the shared spacing token resolved from the anchoring element.
|
|
19
|
+
*
|
|
20
|
+
* Resolution is deferred until a fit asks for it, so only fits that space
|
|
21
|
+
* content away from their anchor pay for the style read.
|
|
22
|
+
*/
|
|
23
|
+
readSpacing: () => number;
|
|
24
|
+
};
|
|
25
|
+
/** A type representing options accepted by the anchored position hook. */
|
|
26
|
+
export type AnchoredPositionOptions<Position extends PositionCoordinates> = {
|
|
27
|
+
/** Whether positioning observers should remain active. */
|
|
28
|
+
active: boolean;
|
|
29
|
+
/** The boundary the content is positioned within. */
|
|
30
|
+
boundary: HTMLElement | null;
|
|
31
|
+
/**
|
|
32
|
+
* Fits the content against the measurements of one repositioning pass.
|
|
33
|
+
*
|
|
34
|
+
* Returning null withholds a position, which suits content that cannot be
|
|
35
|
+
* placed until it has been measured itself.
|
|
36
|
+
*
|
|
37
|
+
* @note Identity must stay stable across renders. Every change reattaches
|
|
38
|
+
* the observers, so callers pass a memoized fit rather than an inline one.
|
|
39
|
+
*/
|
|
40
|
+
fit: (measurement: AnchoredMeasurement) => Position | null;
|
|
41
|
+
/** The mounted content being positioned. */
|
|
42
|
+
panel: HTMLElement | null;
|
|
43
|
+
/** The element anchoring the content. */
|
|
44
|
+
trigger: HTMLElement | null;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Keeps anchored content aligned to its trigger and inside its boundary.
|
|
48
|
+
*
|
|
49
|
+
* The hook owns the measurement lifecycle every anchored layer shares, while
|
|
50
|
+
* the supplied fit decides where the content actually belongs. Coordinates
|
|
51
|
+
* are returned relative to the boundary's padding box, which is what absolute
|
|
52
|
+
* positioning inside the boundary resolves against.
|
|
53
|
+
*
|
|
54
|
+
* @param options - The positioned elements and the fit placing them.
|
|
55
|
+
*
|
|
56
|
+
* @returns The boundary-relative position, or null while none is resolved.
|
|
57
|
+
*/
|
|
58
|
+
export declare function useAnchoredPosition<Position extends PositionCoordinates>(options: AnchoredPositionOptions<Position>): Position | null;
|
|
59
|
+
export {};
|