@radui/ui 0.0.1 → 0.0.2
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/ui/Accordion.es.js +1 -0
- package/dist/ui/Accordion.js +1 -0
- package/dist/ui/Avatar.es.js +1 -0
- package/dist/ui/Avatar.js +1 -0
- package/dist/ui/Badge.es.js +1 -0
- package/dist/ui/Badge.js +1 -0
- package/dist/ui/BlockQuote.es.js +1 -0
- package/dist/ui/BlockQuote.js +1 -0
- package/dist/ui/Button.es.js +1 -0
- package/dist/ui/Button.js +1 -0
- package/dist/ui/Callout.es.js +1 -0
- package/dist/ui/Callout.js +1 -0
- package/dist/ui/Code.es.js +1 -0
- package/dist/ui/Code.js +1 -0
- package/dist/ui/Dropdown.es.js +1 -0
- package/dist/ui/Dropdown.js +1 -0
- package/dist/ui/Em.es.js +1 -0
- package/dist/ui/Em.js +1 -0
- package/dist/ui/Heading.es.js +1 -0
- package/dist/ui/Heading.js +1 -0
- package/dist/ui/Kbd.es.js +1 -0
- package/dist/ui/Kbd.js +1 -0
- package/dist/ui/Link.es.js +1 -0
- package/dist/ui/Link.js +1 -0
- package/dist/ui/Quote.es.js +1 -0
- package/dist/ui/Quote.js +1 -0
- package/dist/ui/Separator.es.js +1 -0
- package/dist/ui/Separator.js +1 -0
- package/dist/ui/Strong.es.js +1 -0
- package/dist/ui/Strong.js +1 -0
- package/dist/ui/Tabs.es.js +1 -0
- package/dist/ui/Tabs.js +1 -0
- package/dist/ui/Text.es.js +1 -0
- package/dist/ui/Text.js +1 -0
- package/dist/ui/TextArea.es.js +1 -0
- package/dist/ui/TextArea.js +1 -0
- package/dist/ui/Tooltip.es.js +1 -0
- package/dist/ui/Tooltip.js +1 -0
- package/package.json +5 -2
- package/dist/index.es.js +0 -3228
- package/dist/index.js +0 -3228
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e,{useState as t}from"react";const n=n=>{let{items:l}=n;const[a,r]=t(null);return e.createElement("div",null,l.map(((t,n)=>e.createElement("div",{key:n},e.createElement("button",{onClick:()=>(e=>{r(a===e?null:e)})(n),"aria-expanded":a===n,"aria-controls":`content-${n}`},t.title),e.createElement("div",{id:`content-${n}`,role:"region","aria-labelledby":`section-${n}`,hidden:a!==n},e.createElement("p",null,t.content))))))};export{n as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e,{useState as t}from"react";const n=n=>{let{items:l}=n;const[a,r]=t(null);return e.createElement("div",null,l.map(((t,n)=>e.createElement("div",{key:n},e.createElement("button",{onClick:()=>(e=>{r(a===e?null:e)})(n),"aria-expanded":a===n,"aria-controls":`content-${n}`},t.title),e.createElement("div",{id:`content-${n}`,role:"region","aria-labelledby":`section-${n}`,hidden:a!==n},e.createElement("p",null,t.content))))))};export{n as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"react";function t(){return t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},t.apply(this,arguments)}const a="Avatar",r=t=>{let{rootClass:a,fallback:r}=t;return e.createElement("div",{className:`${a} ${a}-fallback`},r)},l=l=>{let{children:n,customRootClass:c="",fallback:s="",className:o="",src:i,alt:m,...u}=l;const f=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const a=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return e||(t?`rad-ui-${a}`:"")}(c,a);return i?e.createElement(e.Fragment,null,e.createElement("img",t({src:i,alt:m,className:`${f} ${o}`},u))):e.createElement(r,{fallback:s,rootClass:f})};l.displayName=a;export{l as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"react";function t(){return t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},t.apply(this,arguments)}const a="Avatar",r=t=>{let{rootClass:a,fallback:r}=t;return e.createElement("div",{className:`${a} ${a}-fallback`},r)},l=l=>{let{children:n,customRootClass:c="",fallback:s="",className:o="",src:i,alt:m,...u}=l;const f=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const a=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return e||(t?`rad-ui-${a}`:"")}(c,a);return i?e.createElement(e.Fragment,null,e.createElement("img",t({src:i,alt:m,className:`${f} ${o}`},u))):e.createElement(r,{fallback:s,rootClass:f})};l.displayName=a;export{l as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"react";function e(){return e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(t[r]=a[r])}return t},e.apply(this,arguments)}const a="Badge",r=r=>{let{children:n,customRootClass:o="",className:c="",color:s,...l}=r;const i=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const a=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return t||(e?`rad-ui-${a}`:"")}(o,a);return s&&(l["data-accent-color"]=s),t.createElement("span",e({className:`${i} ${c}`},l),n)};r.displayName=a;export{r as default};
|
package/dist/ui/Badge.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"react";function e(){return e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(t[r]=a[r])}return t},e.apply(this,arguments)}const a="Badge",r=r=>{let{children:n,customRootClass:o="",className:c="",color:s,...l}=r;const i=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const a=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return t||(e?`rad-ui-${a}`:"")}(o,a);return s&&(l["data-accent-color"]=s),t.createElement("span",e({className:`${i} ${c}`},l),n)};r.displayName=a;export{r as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"react";function e(){return e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},e.apply(this,arguments)}const r="BlockQuote",o=o=>{let{children:a,customRootClass:n="",className:c="",...s}=o;const l=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const r=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return t||(e?`rad-ui-${r}`:"")}(n,r);return t.createElement("blockquote",e({className:`${l} ${c}`},s),a)};o.displayName=r;export{o as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"react";function e(){return e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},e.apply(this,arguments)}const r="BlockQuote",o=o=>{let{children:a,customRootClass:n="",className:c="",...s}=o;const l=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const r=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return t||(e?`rad-ui-${r}`:"")}(n,r);return t.createElement("blockquote",e({className:`${l} ${c}`},s),a)};o.displayName=r;export{o as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"react";function r(){return r=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},r.apply(this,arguments)}const e=e=>{let{children:n,type:a="button",color:o,className:c="",variant:l="solid",...s}=e;return o&&(s["data-accent-color"]=o),t.createElement("button",r({type:"button",className:`rad-ui-button button-${l} ${c}`},s),n)};export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"react";function r(){return r=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},r.apply(this,arguments)}const e=e=>{let{children:n,type:a="button",color:o,className:c="",variant:l="solid",...s}=e;return o&&(s["data-accent-color"]=o),t.createElement("button",r({type:"button",className:`rad-ui-button button-${l} ${c}`},s),n)};export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(){return e=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},e.apply(this,arguments)}const t="Callout",l=()=>React.createElement("svg",{width:"18",height:"18",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM8.24992 4.49999C8.24992 4.9142 7.91413 5.24999 7.49992 5.24999C7.08571 5.24999 6.74992 4.9142 6.74992 4.49999C6.74992 4.08577 7.08571 3.74999 7.49992 3.74999C7.91413 3.74999 8.24992 4.08577 8.24992 4.49999ZM6.00003 5.99999H6.50003H7.50003C7.77618 5.99999 8.00003 6.22384 8.00003 6.49999V9.99999H8.50003H9.00003V11H8.50003H7.50003H6.50003H6.00003V9.99999H6.50003H7.00003V6.99999H6.50003H6.00003V5.99999Z",fill:"currentColor","fill-rule":"evenodd","clip-rule":"evenodd"})),a=a=>{let{children:n,className:r="",color:o,customRootClass:c="",...s}=a;const i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const l=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return e||(t?`rad-ui-${l}`:"")}(c,t);return o&&(s["data-accent-color"]=o),React.createElement("div",e({className:`${i} ${r}`},s),React.createElement(l,null)," ",n)};a.displayName=t;export{a as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(){return e=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},e.apply(this,arguments)}const t="Callout",l=()=>React.createElement("svg",{width:"18",height:"18",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM8.24992 4.49999C8.24992 4.9142 7.91413 5.24999 7.49992 5.24999C7.08571 5.24999 6.74992 4.9142 6.74992 4.49999C6.74992 4.08577 7.08571 3.74999 7.49992 3.74999C7.91413 3.74999 8.24992 4.08577 8.24992 4.49999ZM6.00003 5.99999H6.50003H7.50003C7.77618 5.99999 8.00003 6.22384 8.00003 6.49999V9.99999H8.50003H9.00003V11H8.50003H7.50003H6.50003H6.00003V9.99999H6.50003H7.00003V6.99999H6.50003H6.00003V5.99999Z",fill:"currentColor","fill-rule":"evenodd","clip-rule":"evenodd"})),a=a=>{let{children:n,className:r="",color:o,customRootClass:c="",...s}=a;const i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const l=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return e||(t?`rad-ui-${l}`:"")}(c,t);return o&&(s["data-accent-color"]=o),React.createElement("div",e({className:`${i} ${r}`},s),React.createElement(l,null)," ",n)};a.displayName=t;export{a as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"react";const r=r=>{let{children:t}=r;return e.createElement("code",{className:"rui-code-root"},t)};export{r as default};
|
package/dist/ui/Code.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"react";const r=r=>{let{children:t}=r;return e.createElement("code",{className:"rui-code-root"},t)};export{r as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as t from"react";import{useLayoutEffect as e,useEffect as n,useState as o}from"react";import*as r from"react-dom";function i(t){return s(t)?(t.nodeName||"").toLowerCase():"#document"}function l(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function c(t){var e;return null==(e=(s(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function s(t){return t instanceof Node||t instanceof l(t).Node}function a(t){return t instanceof Element||t instanceof l(t).Element}function f(t){return t instanceof HTMLElement||t instanceof l(t).HTMLElement}function u(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ShadowRoot||t instanceof l(t).ShadowRoot)}function d(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=y(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(r)}function m(t){return["table","td","th"].includes(i(t))}function p(t){const e=g(),n=y(t);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((t=>(n.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(n.contain||"").includes(t)))}function g(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function h(t){return["html","body","#document"].includes(i(t))}function y(t){return l(t).getComputedStyle(t)}function w(t){return a(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function x(t){if("html"===i(t))return t;const e=t.assignedSlot||t.parentNode||u(t)&&t.host||c(t);return u(e)?e.host:e}function v(t){const e=x(t);return h(e)?t.ownerDocument?t.ownerDocument.body:t.body:f(e)&&d(e)?e:v(e)}function b(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const r=v(t),i=r===(null==(o=t.ownerDocument)?void 0:o.body),c=l(r);return i?e.concat(c,c.visualViewport||[],d(r)?r:[],c.frameElement&&n?b(c.frameElement):[]):e.concat(r,b(r,[],n))}const R=Math.min,E=Math.max,C=Math.round,S=Math.floor,T=t=>({x:t,y:t}),L={left:"right",right:"left",bottom:"top",top:"bottom"},O={start:"end",end:"start"};function A(t,e,n){return E(t,R(e,n))}function D(t,e){return"function"==typeof t?t(e):t}function P(t){return t.split("-")[0]}function k(t){return t.split("-")[1]}function M(t){return"x"===t?"y":"x"}function F(t){return"y"===t?"height":"width"}function V(t){return["top","bottom"].includes(P(t))?"y":"x"}function N(t){return M(V(t))}function B(t){return t.replace(/start|end/g,(t=>O[t]))}function H(t){return t.replace(/left|right|bottom|top/g,(t=>L[t]))}function W(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function I(t,e,n){let{reference:o,floating:r}=t;const i=V(e),l=N(e),c=F(l),s=P(e),a="y"===i,f=o.x+o.width/2-r.width/2,u=o.y+o.height/2-r.height/2,d=o[c]/2-r[c]/2;let m;switch(s){case"top":m={x:f,y:o.y-r.height};break;case"bottom":m={x:f,y:o.y+o.height};break;case"right":m={x:o.x+o.width,y:u};break;case"left":m={x:o.x-r.width,y:u};break;default:m={x:o.x,y:o.y}}switch(k(e)){case"start":m[l]-=d*(n&&a?-1:1);break;case"end":m[l]+=d*(n&&a?-1:1)}return m}async function z(t,e){var n;void 0===e&&(e={});const{x:o,y:r,platform:i,rects:l,elements:c,strategy:s}=t,{boundary:a="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:d=!1,padding:m=0}=D(e,t),p=function(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}(m),g=c[d?"floating"===u?"reference":"floating":u],h=W(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(c.floating)),boundary:a,rootBoundary:f,strategy:s})),y="floating"===u?{...l.floating,x:o,y:r}:l.reference,w=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c.floating)),x=await(null==i.isElement?void 0:i.isElement(w))&&await(null==i.getScale?void 0:i.getScale(w))||{x:1,y:1},v=W(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:y,offsetParent:w,strategy:s}):y);return{top:(h.top-v.top+p.top)/x.y,bottom:(v.bottom-h.bottom+p.bottom)/x.y,left:(h.left-v.left+p.left)/x.x,right:(v.right-h.right+p.right)/x.x}}const _=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:r,middlewareData:i,rects:l,initialPlacement:c,platform:s,elements:a}=e,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...h}=D(t,e);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=P(r),w=P(c)===c,x=await(null==s.isRTL?void 0:s.isRTL(a.floating)),v=d||(w||!g?[H(c)]:function(t){const e=H(t);return[B(t),e,B(e)]}(c));d||"none"===p||v.push(...function(t,e,n,o){const r=k(t);let i=function(t,e,n){const o=["left","right"],r=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(t){case"top":case"bottom":return n?e?r:o:e?o:r;case"left":case"right":return e?i:l;default:return[]}}(P(t),"start"===n,o);return r&&(i=i.map((t=>t+"-"+r)),e&&(i=i.concat(i.map(B)))),i}(c,g,p,x));const b=[c,...v],R=await z(e,h),E=[];let C=(null==(o=i.flip)?void 0:o.overflows)||[];if(f&&E.push(R[y]),u){const t=function(t,e,n){void 0===n&&(n=!1);const o=k(t),r=N(t),i=F(r);let l="x"===r?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[i]>e.floating[i]&&(l=H(l)),[l,H(l)]}(r,l,x);E.push(R[t[0]],R[t[1]])}if(C=[...C,{placement:r,overflows:E}],!E.every((t=>t<=0))){var S,T;const t=((null==(S=i.flip)?void 0:S.index)||0)+1,e=b[t];if(e)return{data:{index:t,overflows:C},reset:{placement:e}};let n=null==(T=C.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:T.placement;if(!n)switch(m){case"bestFit":{var L;const t=null==(L=C.map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:L[0];t&&(n=t);break}case"initialPlacement":n=c}if(r!==n)return{reset:{placement:n}}}return{}}}};const j=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:r,y:i,placement:l,middlewareData:c}=e,s=await async function(t,e){const{placement:n,platform:o,elements:r}=t,i=await(null==o.isRTL?void 0:o.isRTL(r.floating)),l=P(n),c=k(n),s="y"===V(n),a=["left","top"].includes(l)?-1:1,f=i&&s?-1:1,u=D(e,t);let{mainAxis:d,crossAxis:m,alignmentAxis:p}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return c&&"number"==typeof p&&(m="end"===c?-1*p:p),s?{x:m*f,y:d*a}:{x:d*a,y:m*f}}(e,t);return l===(null==(n=c.offset)?void 0:n.placement)&&null!=(o=c.arrow)&&o.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:l}}}}};function $(t){const e=y(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=f(t),i=r?t.offsetWidth:n,l=r?t.offsetHeight:o,c=C(n)!==i||C(o)!==l;return c&&(n=i,o=l),{width:n,height:o,$:c}}function q(t){return a(t)?t:t.contextElement}function U(t){const e=q(t);if(!f(e))return T(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:i}=$(e);let l=(i?C(n.width):n.width)/o,c=(i?C(n.height):n.height)/r;return l&&Number.isFinite(l)||(l=1),c&&Number.isFinite(c)||(c=1),{x:l,y:c}}const X=T(0);function Y(t){const e=l(t);return g()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:X}function G(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const r=t.getBoundingClientRect(),i=q(t);let c=T(1);e&&(o?a(o)&&(c=U(o)):c=U(t));const s=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==l(t))&&e}(i,n,o)?Y(i):T(0);let f=(r.left+s.x)/c.x,u=(r.top+s.y)/c.y,d=r.width/c.x,m=r.height/c.y;if(i){const t=l(i),e=o&&a(o)?l(o):o;let n=t.frameElement;for(;n&&o&&e!==t;){const t=U(n),e=n.getBoundingClientRect(),o=y(n),r=e.left+(n.clientLeft+parseFloat(o.paddingLeft))*t.x,i=e.top+(n.clientTop+parseFloat(o.paddingTop))*t.y;f*=t.x,u*=t.y,d*=t.x,m*=t.y,f+=r,u+=i,n=l(n).frameElement}}return W({width:d,height:m,x:f,y:u})}function J(t){return G(c(t)).left+w(t).scrollLeft}function K(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=l(t),o=c(t),r=n.visualViewport;let i=o.clientWidth,s=o.clientHeight,a=0,f=0;if(r){i=r.width,s=r.height;const t=g();(!t||t&&"fixed"===e)&&(a=r.offsetLeft,f=r.offsetTop)}return{width:i,height:s,x:a,y:f}}(t,n);else if("document"===e)o=function(t){const e=c(t),n=w(t),o=t.ownerDocument.body,r=E(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=E(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+J(t);const s=-n.scrollTop;return"rtl"===y(o).direction&&(l+=E(e.clientWidth,o.clientWidth)-r),{width:r,height:i,x:l,y:s}}(c(t));else if(a(e))o=function(t,e){const n=G(t,!0,"fixed"===e),o=n.top+t.clientTop,r=n.left+t.clientLeft,i=f(t)?U(t):T(1);return{width:t.clientWidth*i.x,height:t.clientHeight*i.y,x:r*i.x,y:o*i.y}}(e,n);else{const n=Y(t);o={...e,x:e.x-n.x,y:e.y-n.y}}return W(o)}function Q(t,e){const n=x(t);return!(n===e||!a(n)||h(n))&&("fixed"===y(n).position||Q(n,e))}function Z(t,e,n){const o=f(e),r=c(e),l="fixed"===n,s=G(t,!0,l,e);let a={scrollLeft:0,scrollTop:0};const u=T(0);if(o||!o&&!l)if(("body"!==i(e)||d(r))&&(a=w(e)),o){const t=G(e,!0,l,e);u.x=t.x+e.clientLeft,u.y=t.y+e.clientTop}else r&&(u.x=J(r));return{x:s.left+a.scrollLeft-u.x,y:s.top+a.scrollTop-u.y,width:s.width,height:s.height}}function tt(t,e){return f(t)&&"fixed"!==y(t).position?e?e(t):t.offsetParent:null}function et(t,e){const n=l(t);if(!f(t))return n;let o=tt(t,e);for(;o&&m(o)&&"static"===y(o).position;)o=tt(o,e);return o&&("html"===i(o)||"body"===i(o)&&"static"===y(o).position&&!p(o))?n:o||function(t){let e=x(t);for(;f(e)&&!h(e);){if(p(e))return e;e=x(e)}return null}(t)||n}const nt={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:n,strategy:o}=t;const r=f(n),l=c(n);if(n===l)return e;let s={scrollLeft:0,scrollTop:0},a=T(1);const u=T(0);if((r||!r&&"fixed"!==o)&&(("body"!==i(n)||d(l))&&(s=w(n)),f(n))){const t=G(n);a=U(n),u.x=t.x+n.clientLeft,u.y=t.y+n.clientTop}return{width:e.width*a.x,height:e.height*a.y,x:e.x*a.x-s.scrollLeft*a.x+u.x,y:e.y*a.y-s.scrollTop*a.y+u.y}},getDocumentElement:c,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t;const l=[..."clippingAncestors"===n?function(t,e){const n=e.get(t);if(n)return n;let o=b(t,[],!1).filter((t=>a(t)&&"body"!==i(t))),r=null;const l="fixed"===y(t).position;let c=l?x(t):t;for(;a(c)&&!h(c);){const e=y(c),n=p(c);n||"fixed"!==e.position||(r=null),(l?!n&&!r:!n&&"static"===e.position&&r&&["absolute","fixed"].includes(r.position)||d(c)&&!n&&Q(t,c))?o=o.filter((t=>t!==c)):r=e,c=x(c)}return e.set(t,o),o}(e,this._c):[].concat(n),o],c=l[0],s=l.reduce(((t,n)=>{const o=K(e,n,r);return t.top=E(o.top,t.top),t.right=R(o.right,t.right),t.bottom=R(o.bottom,t.bottom),t.left=E(o.left,t.left),t}),K(e,c,r));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:et,getElementRects:async function(t){let{reference:e,floating:n,strategy:o}=t;const r=this.getOffsetParent||et,i=this.getDimensions;return{reference:Z(e,await r(n),o),floating:{x:0,y:0,...await i(n)}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){return $(t)},getScale:U,isElement:a,isRTL:function(t){return"rtl"===y(t).direction}};function ot(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:a=!1}=o,f=q(t),u=r||i?[...f?b(f):[],...b(e)]:[];u.forEach((t=>{r&&t.addEventListener("scroll",n,{passive:!0}),i&&t.addEventListener("resize",n)}));const d=f&&s?function(t,e){let n,o=null;const r=c(t);function i(){clearTimeout(n),o&&o.disconnect(),o=null}return function l(c,s){void 0===c&&(c=!1),void 0===s&&(s=1),i();const{left:a,top:f,width:u,height:d}=t.getBoundingClientRect();if(c||e(),!u||!d)return;const m={rootMargin:-S(f)+"px "+-S(r.clientWidth-(a+u))+"px "+-S(r.clientHeight-(f+d))+"px "+-S(a)+"px",threshold:E(0,R(1,s))||1};let p=!0;function g(t){const e=t[0].intersectionRatio;if(e!==s){if(!p)return l();e?l(!1,e):n=setTimeout((()=>{l(!1,1e-7)}),100)}p=!1}try{o=new IntersectionObserver(g,{...m,root:r.ownerDocument})}catch(t){o=new IntersectionObserver(g,m)}o.observe(t)}(!0),i}(f,n):null;let m,p=-1,g=null;l&&(g=new ResizeObserver((t=>{let[o]=t;o&&o.target===f&&g&&(g.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{g&&g.observe(e)}))),n()})),f&&!a&&g.observe(f),g.observe(e));let h=a?G(t):null;return a&&function e(){const o=G(t);!h||o.x===h.x&&o.y===h.y&&o.width===h.width&&o.height===h.height||n();h=o,m=requestAnimationFrame(e)}(),n(),()=>{u.forEach((t=>{r&&t.removeEventListener("scroll",n),i&&t.removeEventListener("resize",n)})),d&&d(),g&&g.disconnect(),g=null,a&&cancelAnimationFrame(m)}}const rt=(t,e,n)=>{const o=new Map,r={platform:nt,...n},i={...r.platform,_c:o};return(async(t,e,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:l}=n,c=i.filter(Boolean),s=await(null==l.isRTL?void 0:l.isRTL(e));let a=await l.getElementRects({reference:t,floating:e,strategy:r}),{x:f,y:u}=I(a,o,s),d=o,m={},p=0;for(let n=0;n<c.length;n++){const{name:i,fn:g}=c[n],{x:h,y:y,data:w,reset:x}=await g({x:f,y:u,initialPlacement:o,placement:d,strategy:r,middlewareData:m,rects:a,platform:l,elements:{reference:t,floating:e}});f=null!=h?h:f,u=null!=y?y:u,m={...m,[i]:{...m[i],...w}},x&&p<=50&&(p++,"object"==typeof x&&(x.placement&&(d=x.placement),x.rects&&(a=!0===x.rects?await l.getElementRects({reference:t,floating:e,strategy:r}):x.rects),({x:f,y:u}=I(a,d,s))),n=-1)}return{x:f,y:u,placement:d,strategy:r,middlewareData:m}})(t,e,{...r,platform:i})};var it="undefined"!=typeof document?e:n;function lt(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if("function"==typeof t&&t.toString()===e.toString())return!0;let n,o,r;if(t&&e&&"object"==typeof t){if(Array.isArray(t)){if(n=t.length,n!=e.length)return!1;for(o=n;0!=o--;)if(!lt(t[o],e[o]))return!1;return!0}if(r=Object.keys(t),n=r.length,n!==Object.keys(e).length)return!1;for(o=n;0!=o--;)if(!{}.hasOwnProperty.call(e,r[o]))return!1;for(o=n;0!=o--;){const n=r[o];if(("_owner"!==n||!t.$$typeof)&&!lt(t[n],e[n]))return!1}return!0}return t!=t&&e!=e}function ct(t){if("undefined"==typeof window)return 1;return(t.ownerDocument.defaultView||window).devicePixelRatio||1}function st(t,e){const n=ct(t);return Math.round(e*n)/n}function at(e){const n=t.useRef(e);return it((()=>{n.current=e})),n}const ft=t["useInsertionEffect".toString()]||(t=>t());var ut="undefined"!=typeof document?e:n;let dt=!1,mt=0;const pt=()=>"floating-ui-"+mt++;const gt=t["useId".toString()]||function(){const[e,n]=t.useState((()=>dt?pt():void 0));return ut((()=>{null==e&&n(pt())}),[]),t.useEffect((()=>{dt||(dt=!0)}),[]),e};const ht=t.createContext(null),yt=t.createContext(null);let wt;function xt(e){var n;void 0===e&&(e={});const{open:o=!1,onOpenChange:i,nodeId:l}=e;if("production"!==process.env.NODE_ENV){var c;const t="Floating UI: Cannot pass a virtual element to the `elements.reference` option, as it must be a real DOM element. Use `refs.setPositionReference` instead.";var s,f;if(null!=(c=e.elements)&&c.reference&&!a(e.elements.reference))if(null==(s=wt)||!s.has(t))null==(f=wt)||f.add(t),console.error(t)}const[u,d]=t.useState(null),m=(null==(n=e.elements)?void 0:n.reference)||u,p=function(e){void 0===e&&(e={});const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:l,elements:{reference:c,floating:s}={},transform:a=!0,whileElementsMounted:f,open:u}=e,[d,m]=t.useState({x:0,y:0,strategy:o,placement:n,middlewareData:{},isPositioned:!1}),[p,g]=t.useState(i);lt(p,i)||g(i);const[h,y]=t.useState(null),[w,x]=t.useState(null),v=t.useCallback((t=>{t!=C.current&&(C.current=t,y(t))}),[y]),b=t.useCallback((t=>{t!==S.current&&(S.current=t,x(t))}),[x]),R=c||h,E=s||w,C=t.useRef(null),S=t.useRef(null),T=t.useRef(d),L=at(f),O=at(l),A=t.useCallback((()=>{if(!C.current||!S.current)return;const t={placement:n,strategy:o,middleware:p};O.current&&(t.platform=O.current),rt(C.current,S.current,t).then((t=>{const e={...t,isPositioned:!0};D.current&&!lt(T.current,e)&&(T.current=e,r.flushSync((()=>{m(e)})))}))}),[p,n,o,O]);it((()=>{!1===u&&T.current.isPositioned&&(T.current.isPositioned=!1,m((t=>({...t,isPositioned:!1}))))}),[u]);const D=t.useRef(!1);it((()=>(D.current=!0,()=>{D.current=!1})),[]),it((()=>{if(R&&(C.current=R),E&&(S.current=E),R&&E){if(L.current)return L.current(R,E,A);A()}}),[R,E,A,L]);const P=t.useMemo((()=>({reference:C,floating:S,setReference:v,setFloating:b})),[v,b]),k=t.useMemo((()=>({reference:R,floating:E})),[R,E]),M=t.useMemo((()=>{const t={position:o,left:0,top:0};if(!k.floating)return t;const e=st(k.floating,d.x),n=st(k.floating,d.y);return a?{...t,transform:"translate("+e+"px, "+n+"px)",...ct(k.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:e,top:n}}),[o,a,k.floating,d.x,d.y]);return t.useMemo((()=>({...d,update:A,refs:P,elements:k,floatingStyles:M})),[d,A,P,k,M])}(e),g=t.useContext(yt),h=null!=((null==(y=t.useContext(ht))?void 0:y.id)||null);var y;const w=function(e){const n=t.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return ft((()=>{n.current=e})),t.useCallback((function(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return null==n.current?void 0:n.current(...e)}),[])}(((t,e,n)=>{t&&(v.current.openEvent=e),b.emit("openchange",{open:t,event:e,reason:n,nested:h}),null==i||i(t,e,n)})),x=t.useRef(null),v=t.useRef({}),b=t.useState((()=>function(){const t=new Map;return{emit(e,n){var o;null==(o=t.get(e))||o.forEach((t=>t(n)))},on(e,n){t.set(e,[...t.get(e)||[],n])},off(e,n){var o;t.set(e,(null==(o=t.get(e))?void 0:o.filter((t=>t!==n)))||[])}}}()))[0],R=gt(),E=t.useCallback((t=>{const e=a(t)?{getBoundingClientRect:()=>t.getBoundingClientRect(),contextElement:t}:t;p.refs.setReference(e)}),[p.refs]),C=t.useCallback((t=>{(a(t)||null===t)&&(x.current=t,d(t)),(a(p.refs.reference.current)||null===p.refs.reference.current||null!==t&&!a(t))&&p.refs.setReference(t)}),[p.refs]),S=t.useMemo((()=>({...p.refs,setReference:C,setPositionReference:E,domReference:x})),[p.refs,C,E]),T=t.useMemo((()=>({...p.elements,domReference:m})),[p.elements,m]),L=t.useMemo((()=>({...p,refs:S,elements:T,dataRef:v,nodeId:l,floatingId:R,events:b,open:o,onOpenChange:w})),[p,l,R,b,o,w,S,T]);return ut((()=>{const t=null==g?void 0:g.nodesRef.current.find((t=>t.id===l));t&&(t.context=L)})),t.useMemo((()=>({...p,context:L,refs:S,elements:T})),[p,S,T,L])}"production"!==process.env.NODE_ENV&&(wt=new Set);const vt=t=>{const[e,n]=o(!1);var r;return xt({open:e,onOpenChange:n,middleware:[j(10),_(),(void 0===r&&(r={}),{name:"shift",options:r,async fn(t){const{x:e,y:n,placement:o}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:c={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...s}=D(r,t),a={x:e,y:n},f=await z(t,s),u=V(P(o)),d=M(u);let m=a[d],p=a[u];if(i){const t="y"===d?"bottom":"right";m=A(m+f["y"===d?"top":"left"],m,m-f[t])}if(l){const t="y"===u?"bottom":"right";p=A(p+f["y"===u?"top":"left"],p,p-f[t])}const g=c.fn({...t,[d]:m,[u]:p});return{...g,data:{x:g.x-e,y:g.y-n}}}})],whileElementsMounted:ot}),React.createElement("div",null,"Dropdown")};export{vt as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as t from"react";import{useLayoutEffect as e,useEffect as n,useState as o}from"react";import*as r from"react-dom";function i(t){return s(t)?(t.nodeName||"").toLowerCase():"#document"}function l(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function c(t){var e;return null==(e=(s(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function s(t){return t instanceof Node||t instanceof l(t).Node}function a(t){return t instanceof Element||t instanceof l(t).Element}function f(t){return t instanceof HTMLElement||t instanceof l(t).HTMLElement}function u(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ShadowRoot||t instanceof l(t).ShadowRoot)}function d(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=y(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(r)}function m(t){return["table","td","th"].includes(i(t))}function p(t){const e=g(),n=y(t);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((t=>(n.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(n.contain||"").includes(t)))}function g(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function h(t){return["html","body","#document"].includes(i(t))}function y(t){return l(t).getComputedStyle(t)}function w(t){return a(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function x(t){if("html"===i(t))return t;const e=t.assignedSlot||t.parentNode||u(t)&&t.host||c(t);return u(e)?e.host:e}function v(t){const e=x(t);return h(e)?t.ownerDocument?t.ownerDocument.body:t.body:f(e)&&d(e)?e:v(e)}function b(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const r=v(t),i=r===(null==(o=t.ownerDocument)?void 0:o.body),c=l(r);return i?e.concat(c,c.visualViewport||[],d(r)?r:[],c.frameElement&&n?b(c.frameElement):[]):e.concat(r,b(r,[],n))}const R=Math.min,E=Math.max,C=Math.round,S=Math.floor,T=t=>({x:t,y:t}),L={left:"right",right:"left",bottom:"top",top:"bottom"},O={start:"end",end:"start"};function A(t,e,n){return E(t,R(e,n))}function D(t,e){return"function"==typeof t?t(e):t}function P(t){return t.split("-")[0]}function k(t){return t.split("-")[1]}function M(t){return"x"===t?"y":"x"}function F(t){return"y"===t?"height":"width"}function V(t){return["top","bottom"].includes(P(t))?"y":"x"}function N(t){return M(V(t))}function B(t){return t.replace(/start|end/g,(t=>O[t]))}function H(t){return t.replace(/left|right|bottom|top/g,(t=>L[t]))}function W(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function I(t,e,n){let{reference:o,floating:r}=t;const i=V(e),l=N(e),c=F(l),s=P(e),a="y"===i,f=o.x+o.width/2-r.width/2,u=o.y+o.height/2-r.height/2,d=o[c]/2-r[c]/2;let m;switch(s){case"top":m={x:f,y:o.y-r.height};break;case"bottom":m={x:f,y:o.y+o.height};break;case"right":m={x:o.x+o.width,y:u};break;case"left":m={x:o.x-r.width,y:u};break;default:m={x:o.x,y:o.y}}switch(k(e)){case"start":m[l]-=d*(n&&a?-1:1);break;case"end":m[l]+=d*(n&&a?-1:1)}return m}async function z(t,e){var n;void 0===e&&(e={});const{x:o,y:r,platform:i,rects:l,elements:c,strategy:s}=t,{boundary:a="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:d=!1,padding:m=0}=D(e,t),p=function(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}(m),g=c[d?"floating"===u?"reference":"floating":u],h=W(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(c.floating)),boundary:a,rootBoundary:f,strategy:s})),y="floating"===u?{...l.floating,x:o,y:r}:l.reference,w=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c.floating)),x=await(null==i.isElement?void 0:i.isElement(w))&&await(null==i.getScale?void 0:i.getScale(w))||{x:1,y:1},v=W(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:y,offsetParent:w,strategy:s}):y);return{top:(h.top-v.top+p.top)/x.y,bottom:(v.bottom-h.bottom+p.bottom)/x.y,left:(h.left-v.left+p.left)/x.x,right:(v.right-h.right+p.right)/x.x}}const _=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:r,middlewareData:i,rects:l,initialPlacement:c,platform:s,elements:a}=e,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...h}=D(t,e);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=P(r),w=P(c)===c,x=await(null==s.isRTL?void 0:s.isRTL(a.floating)),v=d||(w||!g?[H(c)]:function(t){const e=H(t);return[B(t),e,B(e)]}(c));d||"none"===p||v.push(...function(t,e,n,o){const r=k(t);let i=function(t,e,n){const o=["left","right"],r=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(t){case"top":case"bottom":return n?e?r:o:e?o:r;case"left":case"right":return e?i:l;default:return[]}}(P(t),"start"===n,o);return r&&(i=i.map((t=>t+"-"+r)),e&&(i=i.concat(i.map(B)))),i}(c,g,p,x));const b=[c,...v],R=await z(e,h),E=[];let C=(null==(o=i.flip)?void 0:o.overflows)||[];if(f&&E.push(R[y]),u){const t=function(t,e,n){void 0===n&&(n=!1);const o=k(t),r=N(t),i=F(r);let l="x"===r?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[i]>e.floating[i]&&(l=H(l)),[l,H(l)]}(r,l,x);E.push(R[t[0]],R[t[1]])}if(C=[...C,{placement:r,overflows:E}],!E.every((t=>t<=0))){var S,T;const t=((null==(S=i.flip)?void 0:S.index)||0)+1,e=b[t];if(e)return{data:{index:t,overflows:C},reset:{placement:e}};let n=null==(T=C.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:T.placement;if(!n)switch(m){case"bestFit":{var L;const t=null==(L=C.map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:L[0];t&&(n=t);break}case"initialPlacement":n=c}if(r!==n)return{reset:{placement:n}}}return{}}}};const j=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:r,y:i,placement:l,middlewareData:c}=e,s=await async function(t,e){const{placement:n,platform:o,elements:r}=t,i=await(null==o.isRTL?void 0:o.isRTL(r.floating)),l=P(n),c=k(n),s="y"===V(n),a=["left","top"].includes(l)?-1:1,f=i&&s?-1:1,u=D(e,t);let{mainAxis:d,crossAxis:m,alignmentAxis:p}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return c&&"number"==typeof p&&(m="end"===c?-1*p:p),s?{x:m*f,y:d*a}:{x:d*a,y:m*f}}(e,t);return l===(null==(n=c.offset)?void 0:n.placement)&&null!=(o=c.arrow)&&o.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:l}}}}};function $(t){const e=y(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=f(t),i=r?t.offsetWidth:n,l=r?t.offsetHeight:o,c=C(n)!==i||C(o)!==l;return c&&(n=i,o=l),{width:n,height:o,$:c}}function q(t){return a(t)?t:t.contextElement}function U(t){const e=q(t);if(!f(e))return T(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:i}=$(e);let l=(i?C(n.width):n.width)/o,c=(i?C(n.height):n.height)/r;return l&&Number.isFinite(l)||(l=1),c&&Number.isFinite(c)||(c=1),{x:l,y:c}}const X=T(0);function Y(t){const e=l(t);return g()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:X}function G(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const r=t.getBoundingClientRect(),i=q(t);let c=T(1);e&&(o?a(o)&&(c=U(o)):c=U(t));const s=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==l(t))&&e}(i,n,o)?Y(i):T(0);let f=(r.left+s.x)/c.x,u=(r.top+s.y)/c.y,d=r.width/c.x,m=r.height/c.y;if(i){const t=l(i),e=o&&a(o)?l(o):o;let n=t.frameElement;for(;n&&o&&e!==t;){const t=U(n),e=n.getBoundingClientRect(),o=y(n),r=e.left+(n.clientLeft+parseFloat(o.paddingLeft))*t.x,i=e.top+(n.clientTop+parseFloat(o.paddingTop))*t.y;f*=t.x,u*=t.y,d*=t.x,m*=t.y,f+=r,u+=i,n=l(n).frameElement}}return W({width:d,height:m,x:f,y:u})}function J(t){return G(c(t)).left+w(t).scrollLeft}function K(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=l(t),o=c(t),r=n.visualViewport;let i=o.clientWidth,s=o.clientHeight,a=0,f=0;if(r){i=r.width,s=r.height;const t=g();(!t||t&&"fixed"===e)&&(a=r.offsetLeft,f=r.offsetTop)}return{width:i,height:s,x:a,y:f}}(t,n);else if("document"===e)o=function(t){const e=c(t),n=w(t),o=t.ownerDocument.body,r=E(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=E(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+J(t);const s=-n.scrollTop;return"rtl"===y(o).direction&&(l+=E(e.clientWidth,o.clientWidth)-r),{width:r,height:i,x:l,y:s}}(c(t));else if(a(e))o=function(t,e){const n=G(t,!0,"fixed"===e),o=n.top+t.clientTop,r=n.left+t.clientLeft,i=f(t)?U(t):T(1);return{width:t.clientWidth*i.x,height:t.clientHeight*i.y,x:r*i.x,y:o*i.y}}(e,n);else{const n=Y(t);o={...e,x:e.x-n.x,y:e.y-n.y}}return W(o)}function Q(t,e){const n=x(t);return!(n===e||!a(n)||h(n))&&("fixed"===y(n).position||Q(n,e))}function Z(t,e,n){const o=f(e),r=c(e),l="fixed"===n,s=G(t,!0,l,e);let a={scrollLeft:0,scrollTop:0};const u=T(0);if(o||!o&&!l)if(("body"!==i(e)||d(r))&&(a=w(e)),o){const t=G(e,!0,l,e);u.x=t.x+e.clientLeft,u.y=t.y+e.clientTop}else r&&(u.x=J(r));return{x:s.left+a.scrollLeft-u.x,y:s.top+a.scrollTop-u.y,width:s.width,height:s.height}}function tt(t,e){return f(t)&&"fixed"!==y(t).position?e?e(t):t.offsetParent:null}function et(t,e){const n=l(t);if(!f(t))return n;let o=tt(t,e);for(;o&&m(o)&&"static"===y(o).position;)o=tt(o,e);return o&&("html"===i(o)||"body"===i(o)&&"static"===y(o).position&&!p(o))?n:o||function(t){let e=x(t);for(;f(e)&&!h(e);){if(p(e))return e;e=x(e)}return null}(t)||n}const nt={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:n,strategy:o}=t;const r=f(n),l=c(n);if(n===l)return e;let s={scrollLeft:0,scrollTop:0},a=T(1);const u=T(0);if((r||!r&&"fixed"!==o)&&(("body"!==i(n)||d(l))&&(s=w(n)),f(n))){const t=G(n);a=U(n),u.x=t.x+n.clientLeft,u.y=t.y+n.clientTop}return{width:e.width*a.x,height:e.height*a.y,x:e.x*a.x-s.scrollLeft*a.x+u.x,y:e.y*a.y-s.scrollTop*a.y+u.y}},getDocumentElement:c,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t;const l=[..."clippingAncestors"===n?function(t,e){const n=e.get(t);if(n)return n;let o=b(t,[],!1).filter((t=>a(t)&&"body"!==i(t))),r=null;const l="fixed"===y(t).position;let c=l?x(t):t;for(;a(c)&&!h(c);){const e=y(c),n=p(c);n||"fixed"!==e.position||(r=null),(l?!n&&!r:!n&&"static"===e.position&&r&&["absolute","fixed"].includes(r.position)||d(c)&&!n&&Q(t,c))?o=o.filter((t=>t!==c)):r=e,c=x(c)}return e.set(t,o),o}(e,this._c):[].concat(n),o],c=l[0],s=l.reduce(((t,n)=>{const o=K(e,n,r);return t.top=E(o.top,t.top),t.right=R(o.right,t.right),t.bottom=R(o.bottom,t.bottom),t.left=E(o.left,t.left),t}),K(e,c,r));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:et,getElementRects:async function(t){let{reference:e,floating:n,strategy:o}=t;const r=this.getOffsetParent||et,i=this.getDimensions;return{reference:Z(e,await r(n),o),floating:{x:0,y:0,...await i(n)}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){return $(t)},getScale:U,isElement:a,isRTL:function(t){return"rtl"===y(t).direction}};function ot(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:a=!1}=o,f=q(t),u=r||i?[...f?b(f):[],...b(e)]:[];u.forEach((t=>{r&&t.addEventListener("scroll",n,{passive:!0}),i&&t.addEventListener("resize",n)}));const d=f&&s?function(t,e){let n,o=null;const r=c(t);function i(){clearTimeout(n),o&&o.disconnect(),o=null}return function l(c,s){void 0===c&&(c=!1),void 0===s&&(s=1),i();const{left:a,top:f,width:u,height:d}=t.getBoundingClientRect();if(c||e(),!u||!d)return;const m={rootMargin:-S(f)+"px "+-S(r.clientWidth-(a+u))+"px "+-S(r.clientHeight-(f+d))+"px "+-S(a)+"px",threshold:E(0,R(1,s))||1};let p=!0;function g(t){const e=t[0].intersectionRatio;if(e!==s){if(!p)return l();e?l(!1,e):n=setTimeout((()=>{l(!1,1e-7)}),100)}p=!1}try{o=new IntersectionObserver(g,{...m,root:r.ownerDocument})}catch(t){o=new IntersectionObserver(g,m)}o.observe(t)}(!0),i}(f,n):null;let m,p=-1,g=null;l&&(g=new ResizeObserver((t=>{let[o]=t;o&&o.target===f&&g&&(g.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{g&&g.observe(e)}))),n()})),f&&!a&&g.observe(f),g.observe(e));let h=a?G(t):null;return a&&function e(){const o=G(t);!h||o.x===h.x&&o.y===h.y&&o.width===h.width&&o.height===h.height||n();h=o,m=requestAnimationFrame(e)}(),n(),()=>{u.forEach((t=>{r&&t.removeEventListener("scroll",n),i&&t.removeEventListener("resize",n)})),d&&d(),g&&g.disconnect(),g=null,a&&cancelAnimationFrame(m)}}const rt=(t,e,n)=>{const o=new Map,r={platform:nt,...n},i={...r.platform,_c:o};return(async(t,e,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:l}=n,c=i.filter(Boolean),s=await(null==l.isRTL?void 0:l.isRTL(e));let a=await l.getElementRects({reference:t,floating:e,strategy:r}),{x:f,y:u}=I(a,o,s),d=o,m={},p=0;for(let n=0;n<c.length;n++){const{name:i,fn:g}=c[n],{x:h,y:y,data:w,reset:x}=await g({x:f,y:u,initialPlacement:o,placement:d,strategy:r,middlewareData:m,rects:a,platform:l,elements:{reference:t,floating:e}});f=null!=h?h:f,u=null!=y?y:u,m={...m,[i]:{...m[i],...w}},x&&p<=50&&(p++,"object"==typeof x&&(x.placement&&(d=x.placement),x.rects&&(a=!0===x.rects?await l.getElementRects({reference:t,floating:e,strategy:r}):x.rects),({x:f,y:u}=I(a,d,s))),n=-1)}return{x:f,y:u,placement:d,strategy:r,middlewareData:m}})(t,e,{...r,platform:i})};var it="undefined"!=typeof document?e:n;function lt(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if("function"==typeof t&&t.toString()===e.toString())return!0;let n,o,r;if(t&&e&&"object"==typeof t){if(Array.isArray(t)){if(n=t.length,n!=e.length)return!1;for(o=n;0!=o--;)if(!lt(t[o],e[o]))return!1;return!0}if(r=Object.keys(t),n=r.length,n!==Object.keys(e).length)return!1;for(o=n;0!=o--;)if(!{}.hasOwnProperty.call(e,r[o]))return!1;for(o=n;0!=o--;){const n=r[o];if(("_owner"!==n||!t.$$typeof)&&!lt(t[n],e[n]))return!1}return!0}return t!=t&&e!=e}function ct(t){if("undefined"==typeof window)return 1;return(t.ownerDocument.defaultView||window).devicePixelRatio||1}function st(t,e){const n=ct(t);return Math.round(e*n)/n}function at(e){const n=t.useRef(e);return it((()=>{n.current=e})),n}const ft=t["useInsertionEffect".toString()]||(t=>t());var ut="undefined"!=typeof document?e:n;let dt=!1,mt=0;const pt=()=>"floating-ui-"+mt++;const gt=t["useId".toString()]||function(){const[e,n]=t.useState((()=>dt?pt():void 0));return ut((()=>{null==e&&n(pt())}),[]),t.useEffect((()=>{dt||(dt=!0)}),[]),e};const ht=t.createContext(null),yt=t.createContext(null);let wt;function xt(e){var n;void 0===e&&(e={});const{open:o=!1,onOpenChange:i,nodeId:l}=e;if("production"!==process.env.NODE_ENV){var c;const t="Floating UI: Cannot pass a virtual element to the `elements.reference` option, as it must be a real DOM element. Use `refs.setPositionReference` instead.";var s,f;if(null!=(c=e.elements)&&c.reference&&!a(e.elements.reference))if(null==(s=wt)||!s.has(t))null==(f=wt)||f.add(t),console.error(t)}const[u,d]=t.useState(null),m=(null==(n=e.elements)?void 0:n.reference)||u,p=function(e){void 0===e&&(e={});const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:l,elements:{reference:c,floating:s}={},transform:a=!0,whileElementsMounted:f,open:u}=e,[d,m]=t.useState({x:0,y:0,strategy:o,placement:n,middlewareData:{},isPositioned:!1}),[p,g]=t.useState(i);lt(p,i)||g(i);const[h,y]=t.useState(null),[w,x]=t.useState(null),v=t.useCallback((t=>{t!=C.current&&(C.current=t,y(t))}),[y]),b=t.useCallback((t=>{t!==S.current&&(S.current=t,x(t))}),[x]),R=c||h,E=s||w,C=t.useRef(null),S=t.useRef(null),T=t.useRef(d),L=at(f),O=at(l),A=t.useCallback((()=>{if(!C.current||!S.current)return;const t={placement:n,strategy:o,middleware:p};O.current&&(t.platform=O.current),rt(C.current,S.current,t).then((t=>{const e={...t,isPositioned:!0};D.current&&!lt(T.current,e)&&(T.current=e,r.flushSync((()=>{m(e)})))}))}),[p,n,o,O]);it((()=>{!1===u&&T.current.isPositioned&&(T.current.isPositioned=!1,m((t=>({...t,isPositioned:!1}))))}),[u]);const D=t.useRef(!1);it((()=>(D.current=!0,()=>{D.current=!1})),[]),it((()=>{if(R&&(C.current=R),E&&(S.current=E),R&&E){if(L.current)return L.current(R,E,A);A()}}),[R,E,A,L]);const P=t.useMemo((()=>({reference:C,floating:S,setReference:v,setFloating:b})),[v,b]),k=t.useMemo((()=>({reference:R,floating:E})),[R,E]),M=t.useMemo((()=>{const t={position:o,left:0,top:0};if(!k.floating)return t;const e=st(k.floating,d.x),n=st(k.floating,d.y);return a?{...t,transform:"translate("+e+"px, "+n+"px)",...ct(k.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:e,top:n}}),[o,a,k.floating,d.x,d.y]);return t.useMemo((()=>({...d,update:A,refs:P,elements:k,floatingStyles:M})),[d,A,P,k,M])}(e),g=t.useContext(yt),h=null!=((null==(y=t.useContext(ht))?void 0:y.id)||null);var y;const w=function(e){const n=t.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return ft((()=>{n.current=e})),t.useCallback((function(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return null==n.current?void 0:n.current(...e)}),[])}(((t,e,n)=>{t&&(v.current.openEvent=e),b.emit("openchange",{open:t,event:e,reason:n,nested:h}),null==i||i(t,e,n)})),x=t.useRef(null),v=t.useRef({}),b=t.useState((()=>function(){const t=new Map;return{emit(e,n){var o;null==(o=t.get(e))||o.forEach((t=>t(n)))},on(e,n){t.set(e,[...t.get(e)||[],n])},off(e,n){var o;t.set(e,(null==(o=t.get(e))?void 0:o.filter((t=>t!==n)))||[])}}}()))[0],R=gt(),E=t.useCallback((t=>{const e=a(t)?{getBoundingClientRect:()=>t.getBoundingClientRect(),contextElement:t}:t;p.refs.setReference(e)}),[p.refs]),C=t.useCallback((t=>{(a(t)||null===t)&&(x.current=t,d(t)),(a(p.refs.reference.current)||null===p.refs.reference.current||null!==t&&!a(t))&&p.refs.setReference(t)}),[p.refs]),S=t.useMemo((()=>({...p.refs,setReference:C,setPositionReference:E,domReference:x})),[p.refs,C,E]),T=t.useMemo((()=>({...p.elements,domReference:m})),[p.elements,m]),L=t.useMemo((()=>({...p,refs:S,elements:T,dataRef:v,nodeId:l,floatingId:R,events:b,open:o,onOpenChange:w})),[p,l,R,b,o,w,S,T]);return ut((()=>{const t=null==g?void 0:g.nodesRef.current.find((t=>t.id===l));t&&(t.context=L)})),t.useMemo((()=>({...p,context:L,refs:S,elements:T})),[p,S,T,L])}"production"!==process.env.NODE_ENV&&(wt=new Set);const vt=t=>{const[e,n]=o(!1);var r;return xt({open:e,onOpenChange:n,middleware:[j(10),_(),(void 0===r&&(r={}),{name:"shift",options:r,async fn(t){const{x:e,y:n,placement:o}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:c={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...s}=D(r,t),a={x:e,y:n},f=await z(t,s),u=V(P(o)),d=M(u);let m=a[d],p=a[u];if(i){const t="y"===d?"bottom":"right";m=A(m+f["y"===d?"top":"left"],m,m-f[t])}if(l){const t="y"===u?"bottom":"right";p=A(p+f["y"===u?"top":"left"],p,p-f[t])}const g=c.fn({...t,[d]:m,[u]:p});return{...g,data:{x:g.x-e,y:g.y-n}}}})],whileElementsMounted:ot}),React.createElement("div",null,"Dropdown")};export{vt as default};
|
package/dist/ui/Em.es.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"react";function e(){return e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},e.apply(this,arguments)}const r=r=>{let{children:a,customRootClass:n="",className:o="",...s}=r;const c=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const r=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return t||(e?`rad-ui-${r}`:"")}(n,"Em");return t.createElement("em",e({className:`${c} ${o}`},s),a)};r.displayName="Em";export{r as default};
|
package/dist/ui/Em.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"react";function e(){return e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},e.apply(this,arguments)}const r=r=>{let{children:a,customRootClass:n="",className:o="",...s}=r;const c=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const r=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return t||(e?`rad-ui-${r}`:"")}(n,"Em");return t.createElement("em",e({className:`${c} ${o}`},s),a)};r.displayName="Em";export{r as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import a from"react";function t(){return t=Object.assign?Object.assign.bind():function(a){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(a[n]=e[n])}return a},t.apply(this,arguments)}const e=[{label:"H1",tag:"h1"},{label:"H2",tag:"h2"},{label:"H3",tag:"h3"},{label:"H4",tag:"h4"},{label:"H5",tag:"h5"},{label:"H6",tag:"h6"}],n=function(n){let{children:r,as:l,customRootClass:o="",className:s=""}=n;const c=function(a){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const e=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return a||(t?`rad-ui-${e}`:"")}(o,l||"h1");for(var i=arguments.length,g=new Array(i>1?i-1:0),h=1;h<i;h++)g[h-1]=arguments[h];if(void 0!==l&&e.find((a=>a.tag===l))){const{tag:n}=e.find((a=>a.tag===l));return a.createElement(n,t({className:`${c} ${s}`},g),r)}return a.createElement("h1",t({className:`${c} ${s}`},g),r)};n.displayName="Heading";export{n as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import a from"react";function t(){return t=Object.assign?Object.assign.bind():function(a){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(a[n]=e[n])}return a},t.apply(this,arguments)}const e=[{label:"H1",tag:"h1"},{label:"H2",tag:"h2"},{label:"H3",tag:"h3"},{label:"H4",tag:"h4"},{label:"H5",tag:"h5"},{label:"H6",tag:"h6"}],n=function(n){let{children:r,as:l,customRootClass:o="",className:s=""}=n;const c=function(a){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const e=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return a||(t?`rad-ui-${e}`:"")}(o,l||"h1");for(var i=arguments.length,g=new Array(i>1?i-1:0),h=1;h<i;h++)g[h-1]=arguments[h];if(void 0!==l&&e.find((a=>a.tag===l))){const{tag:n}=e.find((a=>a.tag===l));return a.createElement(n,t({className:`${c} ${s}`},g),r)}return a.createElement("h1",t({className:`${c} ${s}`},g),r)};n.displayName="Heading";export{n as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"react";function e(){return e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},e.apply(this,arguments)}const r=r=>{let{children:n,customRootClass:a="",className:o="",...s}=r;const c=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const r=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return t||(e?`rad-ui-${r}`:"")}(a,"Kbd");return t.createElement("kbd",e({className:`${c} ${o}`},s),n)};export{r as default};
|
package/dist/ui/Kbd.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"react";function e(){return e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},e.apply(this,arguments)}const r=r=>{let{children:n,customRootClass:a="",className:o="",...s}=r;const c=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const r=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return t||(e?`rad-ui-${r}`:"")}(a,"Kbd");return t.createElement("kbd",e({className:`${c} ${o}`},s),n)};export{r as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"react";function e(){return e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},e.apply(this,arguments)}const r="Link",a=a=>{let{children:n,href:o="#",alt:s="",customRootClass:c="",className:l="",...i}=a;const u=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const r=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return t||(e?`rad-ui-${r}`:"")}(c,r);return t.createElement("a",e({href:o,alt:s,className:`${u} ${l}`},i),n)};a.displayName=r;export{a as default};
|
package/dist/ui/Link.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"react";function e(){return e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},e.apply(this,arguments)}const r="Link",a=a=>{let{children:n,href:o="#",alt:s="",customRootClass:c="",className:l="",...i}=a;const u=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const r=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return t||(e?`rad-ui-${r}`:"")}(c,r);return t.createElement("a",e({href:o,alt:s,className:`${u} ${l}`},i),n)};a.displayName=r;export{a as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"react";function e(){return e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},e.apply(this,arguments)}const r="Quote",a=a=>{let{children:n,customRootClass:o="",className:s="",...c}=a;const l=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const r=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return t||(e?`rad-ui-${r}`:"")}(o,r);return t.createElement("q",e({className:`${l} ${s}`},c),n)};a.displayName=r;export{a as default};
|
package/dist/ui/Quote.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"react";function e(){return e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},e.apply(this,arguments)}const r="Quote",a=a=>{let{children:n,customRootClass:o="",className:s="",...c}=a;const l=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const r=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return t||(e?`rad-ui-${r}`:"")}(o,r);return t.createElement("q",e({className:`${l} ${s}`},c),n)};a.displayName=r;export{a as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"react";const e="Separator",a=a=>{let{orientation:o="horizontal",className:r="",customRootClass:l=""}=a;const n=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const a=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return t||(e?`rad-ui-${a}`:"")}(l,e),s="vertical"===o?`${n}-vertical`:`${n}-horizontal`;return t.createElement("div",{className:`${n} ${s} ${r}`})};a.displayName=e;export{a as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"react";const e="Separator",a=a=>{let{orientation:o="horizontal",className:r="",customRootClass:l=""}=a;const n=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const a=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return t||(e?`rad-ui-${a}`:"")}(l,e),s="vertical"===o?`${n}-vertical`:`${n}-horizontal`;return t.createElement("div",{className:`${n} ${s} ${r}`})};a.displayName=e;export{a as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=e=>{let{children:t}=e;return React.createElement("strong",null,t)};export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=e=>{let{children:t}=e;return React.createElement("strong",null,t)};export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e,{useState as t}from"react";const a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const a=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return e||(t?`rad-ui-${a}`:"")};function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&(e[s]=a[s])}return e},s.apply(this,arguments)}const c=t=>{let{tab:c,setActiveTab:n,activeTab:o,className:l="",customRootClass:r,...i}=t;const b=a(r,"TabTrigger"),m=o===c.value;return e.createElement("button",s({role:"tab",className:`${b} ${m?"active":""} ${l}`},i,{onClick:()=>(e=>{n(e.value)})(c)}),e.createElement("span",{className:`${b}-inner`},c.label))};c.displayName="TabTrigger";const n="TabList",o=t=>{let{tabs:s=[],className:o="",setActiveTab:l,activeTab:r,customRootClass:i=""}=t;const b=a(i,n);return e.createElement("div",{role:"tablist","aria-orientation":"horizontal","aria-label":"todo",className:`${b} ${o}`},s.map(((t,a)=>e.createElement(c,{activeTab:r,setActiveTab:l,key:a,tab:t,index:a}))))};o.displayName=n;const l="TabContent",r=t=>{let{tabs:s=[],activeTab:c,className:n="",customRootClass:o=""}=t;const r=a(o,l);return e.createElement("div",{className:`${r} ${n}`},s.map(((t,a)=>t.value===c?e.createElement("div",{key:a},t.content):null)))};r.displayName=l;const i="TabRoot",b=t=>{let{children:c,customRootClass:n="",className:o="",color:l,...r}=t;const b=a(n,i);return l&&(r["data-accent-color"]=l),e.createElement("div",s({className:`${b} ${o}`},r),c)};b.displayName=i;const m=a=>{let{tabs:s=[],...c}=a;const[n,l]=t(s[0].value||"");return e.createElement(b,c,e.createElement(o,{activeTab:n,setActiveTab:l,tabs:s}),e.createElement(r,{activeTab:n,tabs:s}))};m.List=o,m.Content=r,m.Root=b;export{m as default};
|
package/dist/ui/Tabs.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e,{useState as t}from"react";const a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const a=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return e||(t?`rad-ui-${a}`:"")};function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&(e[s]=a[s])}return e},s.apply(this,arguments)}const c=t=>{let{tab:c,setActiveTab:n,activeTab:o,className:l="",customRootClass:r,...i}=t;const b=a(r,"TabTrigger"),m=o===c.value;return e.createElement("button",s({role:"tab",className:`${b} ${m?"active":""} ${l}`},i,{onClick:()=>(e=>{n(e.value)})(c)}),e.createElement("span",{className:`${b}-inner`},c.label))};c.displayName="TabTrigger";const n="TabList",o=t=>{let{tabs:s=[],className:o="",setActiveTab:l,activeTab:r,customRootClass:i=""}=t;const b=a(i,n);return e.createElement("div",{role:"tablist","aria-orientation":"horizontal","aria-label":"todo",className:`${b} ${o}`},s.map(((t,a)=>e.createElement(c,{activeTab:r,setActiveTab:l,key:a,tab:t,index:a}))))};o.displayName=n;const l="TabContent",r=t=>{let{tabs:s=[],activeTab:c,className:n="",customRootClass:o=""}=t;const r=a(o,l);return e.createElement("div",{className:`${r} ${n}`},s.map(((t,a)=>t.value===c?e.createElement("div",{key:a},t.content):null)))};r.displayName=l;const i="TabRoot",b=t=>{let{children:c,customRootClass:n="",className:o="",color:l,...r}=t;const b=a(n,i);return l&&(r["data-accent-color"]=l),e.createElement("div",s({className:`${b} ${o}`},r),c)};b.displayName=i;const m=a=>{let{tabs:s=[],...c}=a;const[n,l]=t(s[0].value||"");return e.createElement(b,c,e.createElement(o,{activeTab:n,setActiveTab:l,tabs:s}),e.createElement(r,{activeTab:n,tabs:s}))};m.List=o,m.Content=r,m.Root=b;export{m as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"react";function e(){return e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},e.apply(this,arguments)}const r="Text",a=a=>{let{children:n,customRootClass:o="",className:s="",...c}=a;const l=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const r=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return t||(e?`rad-ui-${r}`:"")}(o,r);return t.createElement("p",e({className:`${l} ${s}`},c),n)};a.displayName=r;export{a as default};
|
package/dist/ui/Text.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"react";function e(){return e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},e.apply(this,arguments)}const r="Text",a=a=>{let{children:n,customRootClass:o="",className:s="",...c}=a;const l=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const r=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return t||(e?`rad-ui-${r}`:"")}(o,r);return t.createElement("p",e({className:`${l} ${s}`},c),n)};a.displayName=r;export{a as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"react";const t=t=>e.createElement("textarea",null);export{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"react";const t=t=>e.createElement("textarea",null);export{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"react";import{useLayoutEffect as t,useEffect as n,useRef as r,useState as o}from"react";import*as i from"react-dom";function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l.apply(this,arguments)}function c(e){return a(e)?(e.nodeName||"").toLowerCase():"#document"}function s(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function u(e){var t;return null==(t=(a(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function a(e){return e instanceof Node||e instanceof s(e).Node}function f(e){return e instanceof Element||e instanceof s(e).Element}function d(e){return e instanceof HTMLElement||e instanceof s(e).HTMLElement}function m(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof s(e).ShadowRoot)}function p(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=w(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function g(e){return["table","td","th"].includes(c(e))}function v(e){const t=h(),n=w(e);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function h(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function y(e){return["html","body","#document"].includes(c(e))}function w(e){return s(e).getComputedStyle(e)}function b(e){return f(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function x(e){if("html"===c(e))return e;const t=e.assignedSlot||e.parentNode||m(e)&&e.host||u(e);return m(t)?t.host:t}function E(e){const t=x(e);return y(t)?e.ownerDocument?e.ownerDocument.body:e.body:d(t)&&p(t)?t:E(t)}function R(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=E(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),l=s(o);return i?t.concat(l,l.visualViewport||[],p(o)?o:[],l.frameElement&&n?R(l.frameElement):[]):t.concat(o,R(o,[],n))}function P(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&m(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function L(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function C(e){return(null==e?void 0:e.ownerDocument)||document}function k(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function T(e){return"composedPath"in e?e.composedPath()[0]:e.target}const O=Math.min,D=Math.max,M=Math.round,S=e=>({x:e,y:e}),A={left:"right",right:"left",bottom:"top",top:"bottom"},N={start:"end",end:"start"};function F(e,t,n){return D(e,O(t,n))}function W(e,t){return"function"==typeof e?e(t):e}function _(e){return e.split("-")[0]}function V(e){return e.split("-")[1]}function B(e){return"y"===e?"height":"width"}function H(e){return["top","bottom"].includes(_(e))?"y":"x"}function I(e){return"x"===H(e)?"y":"x"}function j(e){return e.replace(/start|end/g,(e=>N[e]))}function $(e){return e.replace(/left|right|bottom|top/g,(e=>A[e]))}function K(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function X(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function Y(e,t,n){let{reference:r,floating:o}=e;const i=H(t),l=I(t),c=B(l),s=_(t),u="y"===i,a=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[c]/2-o[c]/2;let m;switch(s){case"top":m={x:a,y:r.y-o.height};break;case"bottom":m={x:a,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-o.width,y:f};break;default:m={x:r.x,y:r.y}}switch(V(t)){case"start":m[l]-=d*(n&&u?-1:1);break;case"end":m[l]+=d*(n&&u?-1:1)}return m}const U=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:l,elements:c,middlewareData:s}=t,{element:u,padding:a=0}=W(e,t)||{};if(null==u)return{};const f=K(a),d={x:n,y:r},m=I(o),p=B(m),g=await l.getDimensions(u),v="y"===m,h=v?"top":"left",y=v?"bottom":"right",w=v?"clientHeight":"clientWidth",b=i.reference[p]+i.reference[m]-d[m]-i.floating[p],x=d[m]-i.reference[m],E=await(null==l.getOffsetParent?void 0:l.getOffsetParent(u));let R=E?E[w]:0;R&&await(null==l.isElement?void 0:l.isElement(E))||(R=c.floating[w]||i.floating[p]);const P=b/2-x/2,L=R/2-g[p]/2-1,C=O(f[h],L),k=O(f[y],L),T=C,D=R-g[p]-k,M=R/2-g[p]/2+P,S=F(T,M,D),A=!s.arrow&&null!=V(o)&&M!=S&&i.reference[p]/2-(M<T?C:k)-g[p]/2<0,N=A?M<T?M-T:M-D:0;return{[m]:d[m]+N,data:{[m]:S,centerOffset:M-S-N,...A&&{alignmentOffset:N}},reset:A}}}),q=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:l,initialPlacement:c,platform:s,elements:u}=t,{mainAxis:a=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...v}=W(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const h=_(o),y=_(c)===c,w=await(null==s.isRTL?void 0:s.isRTL(u.floating)),b=d||(y||!g?[$(c)]:function(e){const t=$(e);return[j(e),t,j(t)]}(c));d||"none"===p||b.push(...function(e,t,n,r){const o=V(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:l;default:return[]}}(_(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(j)))),i}(c,g,p,w));const x=[c,...b],E=await async function(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:l,elements:c,strategy:s}=e,{boundary:u="clippingAncestors",rootBoundary:a="viewport",elementContext:f="floating",altBoundary:d=!1,padding:m=0}=W(t,e),p=K(m),g=c[d?"floating"===f?"reference":"floating":f],v=X(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(c.floating)),boundary:u,rootBoundary:a,strategy:s})),h="floating"===f?{...l.floating,x:r,y:o}:l.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c.floating)),w=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},b=X(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:h,offsetParent:y,strategy:s}):h);return{top:(v.top-b.top+p.top)/w.y,bottom:(b.bottom-v.bottom+p.bottom)/w.y,left:(v.left-b.left+p.left)/w.x,right:(b.right-v.right+p.right)/w.x}}(t,v),R=[];let P=(null==(r=i.flip)?void 0:r.overflows)||[];if(a&&R.push(E[h]),f){const e=function(e,t,n){void 0===n&&(n=!1);const r=V(e),o=I(e),i=B(o);let l="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=$(l)),[l,$(l)]}(o,l,w);R.push(E[e[0]],E[e[1]])}if(P=[...P,{placement:o,overflows:R}],!R.every((e=>e<=0))){var L,C;const e=((null==(L=i.flip)?void 0:L.index)||0)+1,t=x[e];if(t)return{data:{index:e,overflows:P},reset:{placement:t}};let n=null==(C=P.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:C.placement;if(!n)switch(m){case"bestFit":{var k;const e=null==(k=P.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:k[0];e&&(n=e);break}case"initialPlacement":n=c}if(o!==n)return{reset:{placement:n}}}return{}}}};const Z=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:l,middlewareData:c}=t,s=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),l=_(n),c=V(n),s="y"===H(n),u=["left","top"].includes(l)?-1:1,a=i&&s?-1:1,f=W(t,e);let{mainAxis:d,crossAxis:m,alignmentAxis:p}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return c&&"number"==typeof p&&(m="end"===c?-1*p:p),s?{x:m*a,y:d*u}:{x:d*u,y:m*a}}(t,e);return l===(null==(n=c.offset)?void 0:n.placement)&&null!=(r=c.arrow)&&r.alignmentOffset?{}:{x:o+s.x,y:i+s.y,data:{...s,placement:l}}}}};function z(e){const t=w(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=d(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,c=M(n)!==i||M(r)!==l;return c&&(n=i,r=l),{width:n,height:r,$:c}}function Q(e){return f(e)?e:e.contextElement}function G(e){const t=Q(e);if(!d(t))return S(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=z(t);let l=(i?M(n.width):n.width)/r,c=(i?M(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),c&&Number.isFinite(c)||(c=1),{x:l,y:c}}const J=S(0);function ee(e){const t=s(e);return h()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:J}function te(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Q(e);let l=S(1);t&&(r?f(r)&&(l=G(r)):l=G(e));const c=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==s(e))&&t}(i,n,r)?ee(i):S(0);let u=(o.left+c.x)/l.x,a=(o.top+c.y)/l.y,d=o.width/l.x,m=o.height/l.y;if(i){const e=s(i),t=r&&f(r)?s(r):r;let n=e.frameElement;for(;n&&r&&t!==e;){const e=G(n),t=n.getBoundingClientRect(),r=w(n),o=t.left+(n.clientLeft+parseFloat(r.paddingLeft))*e.x,i=t.top+(n.clientTop+parseFloat(r.paddingTop))*e.y;u*=e.x,a*=e.y,d*=e.x,m*=e.y,u+=o,a+=i,n=s(n).frameElement}}return X({width:d,height:m,x:u,y:a})}function ne(e){return te(u(e)).left+b(e).scrollLeft}function re(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=s(e),r=u(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,c=0,a=0;if(o){i=o.width,l=o.height;const e=h();(!e||e&&"fixed"===t)&&(c=o.offsetLeft,a=o.offsetTop)}return{width:i,height:l,x:c,y:a}}(e,n);else if("document"===t)r=function(e){const t=u(e),n=b(e),r=e.ownerDocument.body,o=D(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=D(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+ne(e);const c=-n.scrollTop;return"rtl"===w(r).direction&&(l+=D(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:c}}(u(e));else if(f(t))r=function(e,t){const n=te(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=d(e)?G(e):S(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=ee(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return X(r)}function oe(e,t){const n=x(e);return!(n===t||!f(n)||y(n))&&("fixed"===w(n).position||oe(n,t))}function ie(e,t,n){const r=d(t),o=u(t),i="fixed"===n,l=te(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const a=S(0);if(r||!r&&!i)if(("body"!==c(t)||p(o))&&(s=b(t)),r){const e=te(t,!0,i,t);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else o&&(a.x=ne(o));return{x:l.left+s.scrollLeft-a.x,y:l.top+s.scrollTop-a.y,width:l.width,height:l.height}}function le(e,t){return d(e)&&"fixed"!==w(e).position?t?t(e):e.offsetParent:null}function ce(e,t){const n=s(e);if(!d(e))return n;let r=le(e,t);for(;r&&g(r)&&"static"===w(r).position;)r=le(r,t);return r&&("html"===c(r)||"body"===c(r)&&"static"===w(r).position&&!v(r))?n:r||function(e){let t=x(e);for(;d(t)&&!y(t);){if(v(t))return t;t=x(t)}return null}(e)||n}const se={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=d(n),i=u(n);if(n===i)return t;let l={scrollLeft:0,scrollTop:0},s=S(1);const a=S(0);if((o||!o&&"fixed"!==r)&&(("body"!==c(n)||p(i))&&(l=b(n)),d(n))){const e=te(n);s=G(n),a.x=e.x+n.clientLeft,a.y=e.y+n.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-l.scrollLeft*s.x+a.x,y:t.y*s.y-l.scrollTop*s.y+a.y}},getDocumentElement:u,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=R(e,[],!1).filter((e=>f(e)&&"body"!==c(e))),o=null;const i="fixed"===w(e).position;let l=i?x(e):e;for(;f(l)&&!y(l);){const t=w(l),n=v(l);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||p(l)&&!n&&oe(e,l))?r=r.filter((e=>e!==l)):o=t,l=x(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=i[0],s=i.reduce(((e,n)=>{const r=re(t,n,o);return e.top=D(r.top,e.top),e.right=O(r.right,e.right),e.bottom=O(r.bottom,e.bottom),e.left=D(r.left,e.left),e}),re(t,l,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:ce,getElementRects:async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||ce,i=this.getDimensions;return{reference:ie(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){return z(e)},getScale:G,isElement:f,isRTL:function(e){return"rtl"===w(e).direction}},ue=(e,t,n)=>{const r=new Map,o={platform:se,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,c=i.filter(Boolean),s=await(null==l.isRTL?void 0:l.isRTL(t));let u=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:a,y:f}=Y(u,r,s),d=r,m={},p=0;for(let n=0;n<c.length;n++){const{name:i,fn:g}=c[n],{x:v,y:h,data:y,reset:w}=await g({x:a,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:m,rects:u,platform:l,elements:{reference:e,floating:t}});a=null!=v?v:a,f=null!=h?h:f,m={...m,[i]:{...m[i],...y}},w&&p<=50&&(p++,"object"==typeof w&&(w.placement&&(d=w.placement),w.rects&&(u=!0===w.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:a,y:f}=Y(u,d,s))),n=-1)}return{x:a,y:f,placement:d,strategy:o,middlewareData:m}})(e,t,{...o,platform:i})};var ae="undefined"!=typeof document?t:n;function fe(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;0!=r--;)if(!fe(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!fe(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function de(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function me(e,t){const n=de(e);return Math.round(t*n)/n}function pe(t){const n=e.useRef(t);return ae((()=>{n.current=t})),n}const ge=e["useInsertionEffect".toString()]||(e=>e());function ve(t){const n=e.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return ge((()=>{n.current=t})),e.useCallback((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return null==n.current?void 0:n.current(...t)}),[])}var he="undefined"!=typeof document?t:n;function ye(){return ye=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ye.apply(this,arguments)}let we=!1,be=0;const xe=()=>"floating-ui-"+be++;const Ee=e["useId".toString()]||function(){const[t,n]=e.useState((()=>we?xe():void 0));return he((()=>{null==t&&n(xe())}),[]),e.useEffect((()=>{we||(we=!0)}),[]),t},Re=e.forwardRef((function(t,n){let{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i}},width:l=14,height:c=7,tipRadius:s=0,strokeWidth:u=0,staticOffset:a,stroke:f,d:d,style:{transform:m,...p}={},...g}=t;"production"!==process.env.NODE_ENV&&(n||console.warn("Floating UI: The `ref` prop is required for the `FloatingArrow`","component."));const v=Ee();if(!o)return null;u*=2;const h=u/2,y=l/2*(s/-8+1),w=c/2*s/4,[b,x]=r.split("-"),E=se.isRTL(o),R=!!d,P="top"===b||"bottom"===b,L=a&&"end"===x?"bottom":"top";let C=a&&"end"===x?"right":"left";a&&E&&(C="end"===x?"left":"right");const k=null!=(null==i?void 0:i.x)?a||i.x:"",T=null!=(null==i?void 0:i.y)?a||i.y:"",O=d||"M0,0 H"+l+" L"+(l-y)+","+(c-w)+" Q"+l/2+","+c+" "+y+","+(c-w)+" Z",D={top:R?"rotate(180deg)":"",left:R?"rotate(90deg)":"rotate(-90deg)",bottom:R?"":"rotate(180deg)",right:R?"rotate(-90deg)":"rotate(90deg)"}[b];return e.createElement("svg",ye({},g,{"aria-hidden":!0,ref:n,width:R?l:l+u,height:l,viewBox:"0 0 "+l+" "+(c>l?c:l),style:{position:"absolute",pointerEvents:"none",[C]:k,[L]:T,[b]:P||R?"100%":"calc(100% - "+u/2+"px)",transform:""+D+(null!=m?m:""),...p}}),u>0&&e.createElement("path",{clipPath:"url(#"+v+")",fill:"none",stroke:f,strokeWidth:u+(d?0:1),d:O}),e.createElement("path",{stroke:u&&!d?g.fill:"none",d:O}),e.createElement("clipPath",{id:v},e.createElement("rect",{x:-h,y:h*(R?-1:1),width:l+u,height:l})))}));const Pe=e.createContext(null),Le=e.createContext(null),Ce=()=>{var t;return(null==(t=e.useContext(Pe))?void 0:t.id)||null},ke=()=>e.useContext(Le);function Te(e){return"data-floating-ui-"+e}function Oe(e){const t=r(e);return he((()=>{t.current=e})),t}const De=Te("safe-polygon");function Me(e,t,n){return n&&!L(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}function Se(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}const Ae={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Ne={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Fe=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};let We;function _e(t){var n;void 0===t&&(t={});const{open:r=!1,onOpenChange:o,nodeId:l}=t;if("production"!==process.env.NODE_ENV){var c;const e="Floating UI: Cannot pass a virtual element to the `elements.reference` option, as it must be a real DOM element. Use `refs.setPositionReference` instead.";var s,u;if(null!=(c=t.elements)&&c.reference&&!f(t.elements.reference))if(null==(s=We)||!s.has(e))null==(u=We)||u.add(e),console.error(e)}const[a,d]=e.useState(null),m=(null==(n=t.elements)?void 0:n.reference)||a,p=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:l,elements:{reference:c,floating:s}={},transform:u=!0,whileElementsMounted:a,open:f}=t,[d,m]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[p,g]=e.useState(o);fe(p,o)||g(o);const[v,h]=e.useState(null),[y,w]=e.useState(null),b=e.useCallback((e=>{e!=P.current&&(P.current=e,h(e))}),[h]),x=e.useCallback((e=>{e!==L.current&&(L.current=e,w(e))}),[w]),E=c||v,R=s||y,P=e.useRef(null),L=e.useRef(null),C=e.useRef(d),k=pe(a),T=pe(l),O=e.useCallback((()=>{if(!P.current||!L.current)return;const e={placement:n,strategy:r,middleware:p};T.current&&(e.platform=T.current),ue(P.current,L.current,e).then((e=>{const t={...e,isPositioned:!0};D.current&&!fe(C.current,t)&&(C.current=t,i.flushSync((()=>{m(t)})))}))}),[p,n,r,T]);ae((()=>{!1===f&&C.current.isPositioned&&(C.current.isPositioned=!1,m((e=>({...e,isPositioned:!1}))))}),[f]);const D=e.useRef(!1);ae((()=>(D.current=!0,()=>{D.current=!1})),[]),ae((()=>{if(E&&(P.current=E),R&&(L.current=R),E&&R){if(k.current)return k.current(E,R,O);O()}}),[E,R,O,k]);const M=e.useMemo((()=>({reference:P,floating:L,setReference:b,setFloating:x})),[b,x]),S=e.useMemo((()=>({reference:E,floating:R})),[E,R]),A=e.useMemo((()=>{const e={position:r,left:0,top:0};if(!S.floating)return e;const t=me(S.floating,d.x),n=me(S.floating,d.y);return u?{...e,transform:"translate("+t+"px, "+n+"px)",...de(S.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}}),[r,u,S.floating,d.x,d.y]);return e.useMemo((()=>({...d,update:O,refs:M,elements:S,floatingStyles:A})),[d,O,M,S,A])}(t),g=ke(),v=null!=Ce(),h=ve(((e,t,n)=>{e&&(w.current.openEvent=t),b.emit("openchange",{open:e,event:t,reason:n,nested:v}),null==o||o(e,t,n)})),y=e.useRef(null),w=e.useRef({}),b=e.useState((()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}()))[0],x=Ee(),E=e.useCallback((e=>{const t=f(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;p.refs.setReference(t)}),[p.refs]),R=e.useCallback((e=>{(f(e)||null===e)&&(y.current=e,d(e)),(f(p.refs.reference.current)||null===p.refs.reference.current||null!==e&&!f(e))&&p.refs.setReference(e)}),[p.refs]),P=e.useMemo((()=>({...p.refs,setReference:R,setPositionReference:E,domReference:y})),[p.refs,R,E]),L=e.useMemo((()=>({...p.elements,domReference:m})),[p.elements,m]),C=e.useMemo((()=>({...p,refs:P,elements:L,dataRef:w,nodeId:l,floatingId:x,events:b,open:r,onOpenChange:h})),[p,l,x,b,r,h,P,L]);return he((()=>{const e=null==g?void 0:g.nodesRef.current.find((e=>e.id===l));e&&(e.context=C)})),e.useMemo((()=>({...p,context:C,refs:P,elements:L})),[p,P,L,C])}"production"!==process.env.NODE_ENV&&(We=new Set);const Ve="active",Be="selected";function He(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[Ve]:t,[Be]:n,...r}=e;i=r}return{..."floating"===n&&{tabIndex:-1},...i,...t.map((t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r})).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,i]=t;var l;o&&[Ve,Be].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof i&&(null==(l=r.get(n))||l.push(i),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];return null==(e=r.get(n))?void 0:e.map((e=>e(...o))).find((e=>void 0!==e))})):e[n]=i)})),e):e),{})}}const Ie=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);const je=t=>{let{popperName:n="",customRootClass:i="",className:c="",children:s,open:u=!1,hoverDelay:a=10,showArrow:m=!0,pop:p=React.createElement(React.Fragment,null),...g}=t;const v=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return e||(t?`rad-ui-${n}`:"")}(i,n),h=r(null),[b,E]=o(u),{refs:O,floatingStyles:D,context:M}=_e({open:b,middleware:[(S={element:h},{name:"arrow",options:S,fn(e){const{element:t,padding:n}="function"==typeof S?S(e):S;return t&&(r=t,{}.hasOwnProperty.call(r,"current"))?null!=t.current?U({element:t.current,padding:n}).fn(e):{}:t?U({element:t,padding:n}).fn(e):{};var r}}),Z(9),q()],onOpenChange:E,placement:"top"});var S;const A=function(t,n){var r;void 0===n&&(n={});const{open:o,floatingId:i}=t,{enabled:l=!0,role:c="dialog"}=n,s=null!=(r=Ie.get(c))?r:c,u=Ee(),a=null!=Ce();return e.useMemo((()=>{if(!l)return{};const e={id:i,...s&&{role:s}};return"tooltip"===s||"label"===c?{reference:{["aria-"+("label"===c?"labelledby":"describedby")]:o?i:void 0},floating:e}:{reference:{"aria-expanded":o?"true":"false","aria-haspopup":"alertdialog"===s?"dialog":s,"aria-controls":o?i:void 0,..."listbox"===s&&{role:"combobox"},..."menu"===s&&{id:u},..."menu"===s&&a&&{role:"menuitem"},..."select"===c&&{"aria-autocomplete":"none"},..."combobox"===c&&{"aria-autocomplete":"list"}},floating:{...e,..."menu"===s&&{"aria-labelledby":u}},item(e){let{active:t,selected:n}=e;const r={role:"option",...t&&{id:i+"-option"}};switch(c){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}}}}),[l,c,s,o,i,u,a])}(M),N=function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,nodeId:i,elements:{reference:l,domReference:c,floating:s},dataRef:u}=t,{enabled:a=!0,escapeKey:m=!0,outsidePress:p=!0,outsidePressEvent:g="pointerdown",referencePress:v=!1,referencePressEvent:h="pointerdown",ancestorScroll:b=!1,bubbles:E,capture:L}=n,O=ke(),D=ve("function"==typeof p?p:()=>!1),M="function"==typeof p?D:p,S=e.useRef(!1),A=e.useRef(!1),{escapeKey:N,outsidePress:F}=Fe(E),{escapeKey:W,outsidePress:_}=Fe(L),V=ve((e=>{if(!r||!a||!m||"Escape"!==e.key)return;const t=O?Se(O.nodesRef.current,i):[];if(!N&&(e.stopPropagation(),t.length>0)){let e=!0;if(t.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),B=ve((e=>{var t;const n=()=>{var t;V(e),null==(t=T(e))||t.removeEventListener("keydown",n)};null==(t=T(e))||t.addEventListener("keydown",n)})),H=ve((e=>{const t=S.current;S.current=!1;const n=A.current;if(A.current=!1,"click"===g&&n)return;if(t)return;if("function"==typeof M&&!M(e))return;const r=T(e),l="["+Te("inert")+"]",u=C(s).querySelectorAll(l);let a=f(r)?r:null;for(;a&&!y(a);){const e=x(a);if(y(e)||!f(e))break;a=e}if(u.length&&f(r)&&!r.matches("html,body")&&!P(r,s)&&Array.from(u).every((e=>!P(a,e))))return;if(d(r)&&s){const t=r.clientWidth>0&&r.scrollWidth>r.clientWidth,n=r.clientHeight>0&&r.scrollHeight>r.clientHeight;let o=n&&e.offsetX>r.clientWidth;if(n&&"rtl"===w(r).direction&&(o=e.offsetX<=r.offsetWidth-r.clientWidth),o||t&&e.offsetY>r.clientHeight)return}const m=O&&Se(O.nodesRef.current,i).some((t=>{var n;return k(e,null==(n=t.context)?void 0:n.elements.floating)}));if(k(e,s)||k(e,c)||m)return;const p=O?Se(O.nodesRef.current,i):[];if(p.length>0){let e=!0;if(p.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}o(!1,e,"outside-press")})),I=ve((e=>{var t;const n=()=>{var t;H(e),null==(t=T(e))||t.removeEventListener(g,n)};null==(t=T(e))||t.addEventListener(g,n)}));return e.useEffect((()=>{if(!r||!a)return;function e(e){o(!1,e,"ancestor-scroll")}u.current.__escapeKeyBubbles=N,u.current.__outsidePressBubbles=F;const t=C(s);m&&t.addEventListener("keydown",W?B:V,W),M&&t.addEventListener(g,_?I:H,_);let n=[];return b&&(f(c)&&(n=R(c)),f(s)&&(n=n.concat(R(s))),!f(l)&&l&&l.contextElement&&(n=n.concat(R(l.contextElement)))),n=n.filter((e=>{var n;return e!==(null==(n=t.defaultView)?void 0:n.visualViewport)})),n.forEach((t=>{t.addEventListener("scroll",e,{passive:!0})})),()=>{m&&t.removeEventListener("keydown",W?B:V,W),M&&t.removeEventListener(g,_?I:H,_),n.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[u,s,c,l,m,M,g,r,o,b,a,N,F,V,W,B,H,_,I]),e.useEffect((()=>{S.current=!1}),[M,g]),e.useMemo((()=>a?{reference:{onKeyDown:V,[Ae[h]]:e=>{v&&o(!1,e.nativeEvent,"reference-press")}},floating:{onKeyDown:V,onMouseDown(){A.current=!0},onMouseUp(){A.current=!0},[Ne[g]]:()=>{S.current=!0}}}:{}),[a,v,g,h,o,V])}(M),F=function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,dataRef:i,events:l,elements:{domReference:c,floating:s},refs:u}=t,{enabled:a=!0,delay:d=0,handleClose:m=null,mouseOnly:p=!1,restMs:g=0,move:v=!0}=n,h=ke(),y=Ce(),w=Oe(m),b=Oe(d),x=e.useRef(),E=e.useRef(),R=e.useRef(),k=e.useRef(),T=e.useRef(!0),O=e.useRef(!1),D=e.useRef((()=>{})),M=e.useCallback((()=>{var e;const t=null==(e=i.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[i]);e.useEffect((()=>{if(a)return l.on("openchange",e),()=>{l.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(E.current),clearTimeout(k.current),T.current=!0)}}),[a,l]),e.useEffect((()=>{if(!a||!w.current||!r)return;function e(e){M()&&o(!1,e,"hover")}const t=C(s).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[s,r,o,a,w,i,M]);const S=e.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const r=Me(b.current,"close",x.current);r&&!R.current?(clearTimeout(E.current),E.current=setTimeout((()=>o(!1,e,n)),r)):t&&(clearTimeout(E.current),o(!1,e,n))}),[b,o]),A=e.useCallback((()=>{D.current(),R.current=void 0}),[]),N=e.useCallback((()=>{if(O.current){const e=C(u.floating.current).body;e.style.pointerEvents="",e.removeAttribute(De),O.current=!1}}),[u]);return e.useEffect((()=>{if(a&&f(c)){const e=c;return r&&e.addEventListener("mouseleave",u),null==s||s.addEventListener("mouseleave",u),v&&e.addEventListener("mousemove",n,{once:!0}),e.addEventListener("mouseenter",n),e.addEventListener("mouseleave",l),()=>{r&&e.removeEventListener("mouseleave",u),null==s||s.removeEventListener("mouseleave",u),v&&e.removeEventListener("mousemove",n),e.removeEventListener("mouseenter",n),e.removeEventListener("mouseleave",l)}}function e(){return!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type)}function n(e){if(clearTimeout(E.current),T.current=!1,p&&!L(x.current)||g>0&&0===Me(b.current,"open"))return;const t=Me(b.current,"open",x.current);t?E.current=setTimeout((()=>{o(!0,e,"hover")}),t):o(!0,e,"hover")}function l(n){if(e())return;D.current();const o=C(s);if(clearTimeout(k.current),w.current){r||clearTimeout(E.current),R.current=w.current({...t,tree:h,x:n.clientX,y:n.clientY,onClose(){N(),A(),S(n,!0,"safe-polygon")}});const e=R.current;return o.addEventListener("mousemove",e),void(D.current=()=>{o.removeEventListener("mousemove",e)})}("touch"!==x.current||!P(s,n.relatedTarget))&&S(n)}function u(n){e()||null==w.current||w.current({...t,tree:h,x:n.clientX,y:n.clientY,onClose(){N(),A(),S(n)}})(n)}}),[c,s,a,t,p,g,v,S,A,N,o,r,h,b,w,i]),he((()=>{var e;if(a&&r&&null!=(e=w.current)&&e.__options.blockPointerEvents&&M()){const e=C(s).body;if(e.setAttribute(De,""),e.style.pointerEvents="none",O.current=!0,f(c)&&s){var t;const e=c,n=null==h||null==(t=h.nodesRef.current.find((e=>e.id===y)))||null==(t=t.context)?void 0:t.elements.floating;return n&&(n.style.pointerEvents=""),e.style.pointerEvents="auto",s.style.pointerEvents="auto",()=>{e.style.pointerEvents="",s.style.pointerEvents=""}}}}),[a,r,y,s,c,h,w,i,M]),he((()=>{r||(x.current=void 0,A(),N())}),[r,A,N]),e.useEffect((()=>()=>{A(),clearTimeout(E.current),clearTimeout(k.current),N()}),[a,c,A,N]),e.useMemo((()=>{if(!a)return{};function e(e){x.current=e.pointerType}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove(e){r||0===g||(clearTimeout(k.current),k.current=setTimeout((()=>{T.current||o(!0,e.nativeEvent,"hover")}),g))}},floating:{onMouseEnter(){clearTimeout(E.current)},onMouseLeave(e){S(e.nativeEvent,!1)}}}}),[a,g,r,o,S])}(M,{}),{getReferenceProps:W,getFloatingProps:_}=function(t){void 0===t&&(t=[]);const n=t,r=e.useCallback((e=>He(e,t,"reference")),n),o=e.useCallback((e=>He(e,t,"floating")),n),i=e.useCallback((e=>He(e,t,"item")),t.map((e=>null==e?void 0:e.item)));return e.useMemo((()=>({getReferenceProps:r,getFloatingProps:o,getItemProps:i})),[r,o,i])}([F,A,N]);return React.createElement(React.Fragment,null,React.createElement("span",l({className:`${v}-reference-element ${c}`,ref:O.setReference},W({onClick:()=>{console.log("click")}})),s),b&&React.createElement("div",l({className:`${v}-floating-element`,ref:O.setFloating,style:D},_()),m&&React.createElement(Re,{className:`rad-ui-arrow ${v}-arrow`,ref:h,context:M}),p))},$e=e=>{let{children:t,label:n,...r}=e;return React.createElement("div",null,React.createElement(je,l({popperName:"Tooltip",pop:"hello"},r),t))};export{$e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"react";import{useLayoutEffect as t,useEffect as n,useRef as r,useState as o}from"react";import*as i from"react-dom";function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l.apply(this,arguments)}function c(e){return a(e)?(e.nodeName||"").toLowerCase():"#document"}function s(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function u(e){var t;return null==(t=(a(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function a(e){return e instanceof Node||e instanceof s(e).Node}function f(e){return e instanceof Element||e instanceof s(e).Element}function d(e){return e instanceof HTMLElement||e instanceof s(e).HTMLElement}function m(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof s(e).ShadowRoot)}function p(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=w(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function g(e){return["table","td","th"].includes(c(e))}function v(e){const t=h(),n=w(e);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function h(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function y(e){return["html","body","#document"].includes(c(e))}function w(e){return s(e).getComputedStyle(e)}function b(e){return f(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function x(e){if("html"===c(e))return e;const t=e.assignedSlot||e.parentNode||m(e)&&e.host||u(e);return m(t)?t.host:t}function E(e){const t=x(e);return y(t)?e.ownerDocument?e.ownerDocument.body:e.body:d(t)&&p(t)?t:E(t)}function R(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=E(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),l=s(o);return i?t.concat(l,l.visualViewport||[],p(o)?o:[],l.frameElement&&n?R(l.frameElement):[]):t.concat(o,R(o,[],n))}function P(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&m(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function L(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function C(e){return(null==e?void 0:e.ownerDocument)||document}function k(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function T(e){return"composedPath"in e?e.composedPath()[0]:e.target}const O=Math.min,D=Math.max,M=Math.round,S=e=>({x:e,y:e}),A={left:"right",right:"left",bottom:"top",top:"bottom"},N={start:"end",end:"start"};function F(e,t,n){return D(e,O(t,n))}function W(e,t){return"function"==typeof e?e(t):e}function _(e){return e.split("-")[0]}function V(e){return e.split("-")[1]}function B(e){return"y"===e?"height":"width"}function H(e){return["top","bottom"].includes(_(e))?"y":"x"}function I(e){return"x"===H(e)?"y":"x"}function j(e){return e.replace(/start|end/g,(e=>N[e]))}function $(e){return e.replace(/left|right|bottom|top/g,(e=>A[e]))}function K(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function X(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function Y(e,t,n){let{reference:r,floating:o}=e;const i=H(t),l=I(t),c=B(l),s=_(t),u="y"===i,a=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[c]/2-o[c]/2;let m;switch(s){case"top":m={x:a,y:r.y-o.height};break;case"bottom":m={x:a,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-o.width,y:f};break;default:m={x:r.x,y:r.y}}switch(V(t)){case"start":m[l]-=d*(n&&u?-1:1);break;case"end":m[l]+=d*(n&&u?-1:1)}return m}const U=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:l,elements:c,middlewareData:s}=t,{element:u,padding:a=0}=W(e,t)||{};if(null==u)return{};const f=K(a),d={x:n,y:r},m=I(o),p=B(m),g=await l.getDimensions(u),v="y"===m,h=v?"top":"left",y=v?"bottom":"right",w=v?"clientHeight":"clientWidth",b=i.reference[p]+i.reference[m]-d[m]-i.floating[p],x=d[m]-i.reference[m],E=await(null==l.getOffsetParent?void 0:l.getOffsetParent(u));let R=E?E[w]:0;R&&await(null==l.isElement?void 0:l.isElement(E))||(R=c.floating[w]||i.floating[p]);const P=b/2-x/2,L=R/2-g[p]/2-1,C=O(f[h],L),k=O(f[y],L),T=C,D=R-g[p]-k,M=R/2-g[p]/2+P,S=F(T,M,D),A=!s.arrow&&null!=V(o)&&M!=S&&i.reference[p]/2-(M<T?C:k)-g[p]/2<0,N=A?M<T?M-T:M-D:0;return{[m]:d[m]+N,data:{[m]:S,centerOffset:M-S-N,...A&&{alignmentOffset:N}},reset:A}}}),q=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:l,initialPlacement:c,platform:s,elements:u}=t,{mainAxis:a=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...v}=W(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const h=_(o),y=_(c)===c,w=await(null==s.isRTL?void 0:s.isRTL(u.floating)),b=d||(y||!g?[$(c)]:function(e){const t=$(e);return[j(e),t,j(t)]}(c));d||"none"===p||b.push(...function(e,t,n,r){const o=V(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:l;default:return[]}}(_(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(j)))),i}(c,g,p,w));const x=[c,...b],E=await async function(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:l,elements:c,strategy:s}=e,{boundary:u="clippingAncestors",rootBoundary:a="viewport",elementContext:f="floating",altBoundary:d=!1,padding:m=0}=W(t,e),p=K(m),g=c[d?"floating"===f?"reference":"floating":f],v=X(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(c.floating)),boundary:u,rootBoundary:a,strategy:s})),h="floating"===f?{...l.floating,x:r,y:o}:l.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c.floating)),w=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},b=X(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:h,offsetParent:y,strategy:s}):h);return{top:(v.top-b.top+p.top)/w.y,bottom:(b.bottom-v.bottom+p.bottom)/w.y,left:(v.left-b.left+p.left)/w.x,right:(b.right-v.right+p.right)/w.x}}(t,v),R=[];let P=(null==(r=i.flip)?void 0:r.overflows)||[];if(a&&R.push(E[h]),f){const e=function(e,t,n){void 0===n&&(n=!1);const r=V(e),o=I(e),i=B(o);let l="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=$(l)),[l,$(l)]}(o,l,w);R.push(E[e[0]],E[e[1]])}if(P=[...P,{placement:o,overflows:R}],!R.every((e=>e<=0))){var L,C;const e=((null==(L=i.flip)?void 0:L.index)||0)+1,t=x[e];if(t)return{data:{index:e,overflows:P},reset:{placement:t}};let n=null==(C=P.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:C.placement;if(!n)switch(m){case"bestFit":{var k;const e=null==(k=P.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:k[0];e&&(n=e);break}case"initialPlacement":n=c}if(o!==n)return{reset:{placement:n}}}return{}}}};const Z=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:l,middlewareData:c}=t,s=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),l=_(n),c=V(n),s="y"===H(n),u=["left","top"].includes(l)?-1:1,a=i&&s?-1:1,f=W(t,e);let{mainAxis:d,crossAxis:m,alignmentAxis:p}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return c&&"number"==typeof p&&(m="end"===c?-1*p:p),s?{x:m*a,y:d*u}:{x:d*u,y:m*a}}(t,e);return l===(null==(n=c.offset)?void 0:n.placement)&&null!=(r=c.arrow)&&r.alignmentOffset?{}:{x:o+s.x,y:i+s.y,data:{...s,placement:l}}}}};function z(e){const t=w(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=d(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,c=M(n)!==i||M(r)!==l;return c&&(n=i,r=l),{width:n,height:r,$:c}}function Q(e){return f(e)?e:e.contextElement}function G(e){const t=Q(e);if(!d(t))return S(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=z(t);let l=(i?M(n.width):n.width)/r,c=(i?M(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),c&&Number.isFinite(c)||(c=1),{x:l,y:c}}const J=S(0);function ee(e){const t=s(e);return h()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:J}function te(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Q(e);let l=S(1);t&&(r?f(r)&&(l=G(r)):l=G(e));const c=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==s(e))&&t}(i,n,r)?ee(i):S(0);let u=(o.left+c.x)/l.x,a=(o.top+c.y)/l.y,d=o.width/l.x,m=o.height/l.y;if(i){const e=s(i),t=r&&f(r)?s(r):r;let n=e.frameElement;for(;n&&r&&t!==e;){const e=G(n),t=n.getBoundingClientRect(),r=w(n),o=t.left+(n.clientLeft+parseFloat(r.paddingLeft))*e.x,i=t.top+(n.clientTop+parseFloat(r.paddingTop))*e.y;u*=e.x,a*=e.y,d*=e.x,m*=e.y,u+=o,a+=i,n=s(n).frameElement}}return X({width:d,height:m,x:u,y:a})}function ne(e){return te(u(e)).left+b(e).scrollLeft}function re(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=s(e),r=u(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,c=0,a=0;if(o){i=o.width,l=o.height;const e=h();(!e||e&&"fixed"===t)&&(c=o.offsetLeft,a=o.offsetTop)}return{width:i,height:l,x:c,y:a}}(e,n);else if("document"===t)r=function(e){const t=u(e),n=b(e),r=e.ownerDocument.body,o=D(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=D(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+ne(e);const c=-n.scrollTop;return"rtl"===w(r).direction&&(l+=D(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:c}}(u(e));else if(f(t))r=function(e,t){const n=te(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=d(e)?G(e):S(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=ee(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return X(r)}function oe(e,t){const n=x(e);return!(n===t||!f(n)||y(n))&&("fixed"===w(n).position||oe(n,t))}function ie(e,t,n){const r=d(t),o=u(t),i="fixed"===n,l=te(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const a=S(0);if(r||!r&&!i)if(("body"!==c(t)||p(o))&&(s=b(t)),r){const e=te(t,!0,i,t);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else o&&(a.x=ne(o));return{x:l.left+s.scrollLeft-a.x,y:l.top+s.scrollTop-a.y,width:l.width,height:l.height}}function le(e,t){return d(e)&&"fixed"!==w(e).position?t?t(e):e.offsetParent:null}function ce(e,t){const n=s(e);if(!d(e))return n;let r=le(e,t);for(;r&&g(r)&&"static"===w(r).position;)r=le(r,t);return r&&("html"===c(r)||"body"===c(r)&&"static"===w(r).position&&!v(r))?n:r||function(e){let t=x(e);for(;d(t)&&!y(t);){if(v(t))return t;t=x(t)}return null}(e)||n}const se={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=d(n),i=u(n);if(n===i)return t;let l={scrollLeft:0,scrollTop:0},s=S(1);const a=S(0);if((o||!o&&"fixed"!==r)&&(("body"!==c(n)||p(i))&&(l=b(n)),d(n))){const e=te(n);s=G(n),a.x=e.x+n.clientLeft,a.y=e.y+n.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-l.scrollLeft*s.x+a.x,y:t.y*s.y-l.scrollTop*s.y+a.y}},getDocumentElement:u,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=R(e,[],!1).filter((e=>f(e)&&"body"!==c(e))),o=null;const i="fixed"===w(e).position;let l=i?x(e):e;for(;f(l)&&!y(l);){const t=w(l),n=v(l);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||p(l)&&!n&&oe(e,l))?r=r.filter((e=>e!==l)):o=t,l=x(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=i[0],s=i.reduce(((e,n)=>{const r=re(t,n,o);return e.top=D(r.top,e.top),e.right=O(r.right,e.right),e.bottom=O(r.bottom,e.bottom),e.left=D(r.left,e.left),e}),re(t,l,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:ce,getElementRects:async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||ce,i=this.getDimensions;return{reference:ie(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){return z(e)},getScale:G,isElement:f,isRTL:function(e){return"rtl"===w(e).direction}},ue=(e,t,n)=>{const r=new Map,o={platform:se,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,c=i.filter(Boolean),s=await(null==l.isRTL?void 0:l.isRTL(t));let u=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:a,y:f}=Y(u,r,s),d=r,m={},p=0;for(let n=0;n<c.length;n++){const{name:i,fn:g}=c[n],{x:v,y:h,data:y,reset:w}=await g({x:a,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:m,rects:u,platform:l,elements:{reference:e,floating:t}});a=null!=v?v:a,f=null!=h?h:f,m={...m,[i]:{...m[i],...y}},w&&p<=50&&(p++,"object"==typeof w&&(w.placement&&(d=w.placement),w.rects&&(u=!0===w.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:a,y:f}=Y(u,d,s))),n=-1)}return{x:a,y:f,placement:d,strategy:o,middlewareData:m}})(e,t,{...o,platform:i})};var ae="undefined"!=typeof document?t:n;function fe(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;0!=r--;)if(!fe(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!fe(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function de(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function me(e,t){const n=de(e);return Math.round(t*n)/n}function pe(t){const n=e.useRef(t);return ae((()=>{n.current=t})),n}const ge=e["useInsertionEffect".toString()]||(e=>e());function ve(t){const n=e.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return ge((()=>{n.current=t})),e.useCallback((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return null==n.current?void 0:n.current(...t)}),[])}var he="undefined"!=typeof document?t:n;function ye(){return ye=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ye.apply(this,arguments)}let we=!1,be=0;const xe=()=>"floating-ui-"+be++;const Ee=e["useId".toString()]||function(){const[t,n]=e.useState((()=>we?xe():void 0));return he((()=>{null==t&&n(xe())}),[]),e.useEffect((()=>{we||(we=!0)}),[]),t},Re=e.forwardRef((function(t,n){let{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i}},width:l=14,height:c=7,tipRadius:s=0,strokeWidth:u=0,staticOffset:a,stroke:f,d:d,style:{transform:m,...p}={},...g}=t;"production"!==process.env.NODE_ENV&&(n||console.warn("Floating UI: The `ref` prop is required for the `FloatingArrow`","component."));const v=Ee();if(!o)return null;u*=2;const h=u/2,y=l/2*(s/-8+1),w=c/2*s/4,[b,x]=r.split("-"),E=se.isRTL(o),R=!!d,P="top"===b||"bottom"===b,L=a&&"end"===x?"bottom":"top";let C=a&&"end"===x?"right":"left";a&&E&&(C="end"===x?"left":"right");const k=null!=(null==i?void 0:i.x)?a||i.x:"",T=null!=(null==i?void 0:i.y)?a||i.y:"",O=d||"M0,0 H"+l+" L"+(l-y)+","+(c-w)+" Q"+l/2+","+c+" "+y+","+(c-w)+" Z",D={top:R?"rotate(180deg)":"",left:R?"rotate(90deg)":"rotate(-90deg)",bottom:R?"":"rotate(180deg)",right:R?"rotate(-90deg)":"rotate(90deg)"}[b];return e.createElement("svg",ye({},g,{"aria-hidden":!0,ref:n,width:R?l:l+u,height:l,viewBox:"0 0 "+l+" "+(c>l?c:l),style:{position:"absolute",pointerEvents:"none",[C]:k,[L]:T,[b]:P||R?"100%":"calc(100% - "+u/2+"px)",transform:""+D+(null!=m?m:""),...p}}),u>0&&e.createElement("path",{clipPath:"url(#"+v+")",fill:"none",stroke:f,strokeWidth:u+(d?0:1),d:O}),e.createElement("path",{stroke:u&&!d?g.fill:"none",d:O}),e.createElement("clipPath",{id:v},e.createElement("rect",{x:-h,y:h*(R?-1:1),width:l+u,height:l})))}));const Pe=e.createContext(null),Le=e.createContext(null),Ce=()=>{var t;return(null==(t=e.useContext(Pe))?void 0:t.id)||null},ke=()=>e.useContext(Le);function Te(e){return"data-floating-ui-"+e}function Oe(e){const t=r(e);return he((()=>{t.current=e})),t}const De=Te("safe-polygon");function Me(e,t,n){return n&&!L(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}function Se(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}const Ae={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Ne={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Fe=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};let We;function _e(t){var n;void 0===t&&(t={});const{open:r=!1,onOpenChange:o,nodeId:l}=t;if("production"!==process.env.NODE_ENV){var c;const e="Floating UI: Cannot pass a virtual element to the `elements.reference` option, as it must be a real DOM element. Use `refs.setPositionReference` instead.";var s,u;if(null!=(c=t.elements)&&c.reference&&!f(t.elements.reference))if(null==(s=We)||!s.has(e))null==(u=We)||u.add(e),console.error(e)}const[a,d]=e.useState(null),m=(null==(n=t.elements)?void 0:n.reference)||a,p=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:l,elements:{reference:c,floating:s}={},transform:u=!0,whileElementsMounted:a,open:f}=t,[d,m]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[p,g]=e.useState(o);fe(p,o)||g(o);const[v,h]=e.useState(null),[y,w]=e.useState(null),b=e.useCallback((e=>{e!=P.current&&(P.current=e,h(e))}),[h]),x=e.useCallback((e=>{e!==L.current&&(L.current=e,w(e))}),[w]),E=c||v,R=s||y,P=e.useRef(null),L=e.useRef(null),C=e.useRef(d),k=pe(a),T=pe(l),O=e.useCallback((()=>{if(!P.current||!L.current)return;const e={placement:n,strategy:r,middleware:p};T.current&&(e.platform=T.current),ue(P.current,L.current,e).then((e=>{const t={...e,isPositioned:!0};D.current&&!fe(C.current,t)&&(C.current=t,i.flushSync((()=>{m(t)})))}))}),[p,n,r,T]);ae((()=>{!1===f&&C.current.isPositioned&&(C.current.isPositioned=!1,m((e=>({...e,isPositioned:!1}))))}),[f]);const D=e.useRef(!1);ae((()=>(D.current=!0,()=>{D.current=!1})),[]),ae((()=>{if(E&&(P.current=E),R&&(L.current=R),E&&R){if(k.current)return k.current(E,R,O);O()}}),[E,R,O,k]);const M=e.useMemo((()=>({reference:P,floating:L,setReference:b,setFloating:x})),[b,x]),S=e.useMemo((()=>({reference:E,floating:R})),[E,R]),A=e.useMemo((()=>{const e={position:r,left:0,top:0};if(!S.floating)return e;const t=me(S.floating,d.x),n=me(S.floating,d.y);return u?{...e,transform:"translate("+t+"px, "+n+"px)",...de(S.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}}),[r,u,S.floating,d.x,d.y]);return e.useMemo((()=>({...d,update:O,refs:M,elements:S,floatingStyles:A})),[d,O,M,S,A])}(t),g=ke(),v=null!=Ce(),h=ve(((e,t,n)=>{e&&(w.current.openEvent=t),b.emit("openchange",{open:e,event:t,reason:n,nested:v}),null==o||o(e,t,n)})),y=e.useRef(null),w=e.useRef({}),b=e.useState((()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}()))[0],x=Ee(),E=e.useCallback((e=>{const t=f(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;p.refs.setReference(t)}),[p.refs]),R=e.useCallback((e=>{(f(e)||null===e)&&(y.current=e,d(e)),(f(p.refs.reference.current)||null===p.refs.reference.current||null!==e&&!f(e))&&p.refs.setReference(e)}),[p.refs]),P=e.useMemo((()=>({...p.refs,setReference:R,setPositionReference:E,domReference:y})),[p.refs,R,E]),L=e.useMemo((()=>({...p.elements,domReference:m})),[p.elements,m]),C=e.useMemo((()=>({...p,refs:P,elements:L,dataRef:w,nodeId:l,floatingId:x,events:b,open:r,onOpenChange:h})),[p,l,x,b,r,h,P,L]);return he((()=>{const e=null==g?void 0:g.nodesRef.current.find((e=>e.id===l));e&&(e.context=C)})),e.useMemo((()=>({...p,context:C,refs:P,elements:L})),[p,P,L,C])}"production"!==process.env.NODE_ENV&&(We=new Set);const Ve="active",Be="selected";function He(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[Ve]:t,[Be]:n,...r}=e;i=r}return{..."floating"===n&&{tabIndex:-1},...i,...t.map((t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r})).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,i]=t;var l;o&&[Ve,Be].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof i&&(null==(l=r.get(n))||l.push(i),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];return null==(e=r.get(n))?void 0:e.map((e=>e(...o))).find((e=>void 0!==e))})):e[n]=i)})),e):e),{})}}const Ie=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);const je=t=>{let{popperName:n="",customRootClass:i="",className:c="",children:s,open:u=!1,hoverDelay:a=10,showArrow:m=!0,pop:p=React.createElement(React.Fragment,null),...g}=t;const v=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return e||(t?`rad-ui-${n}`:"")}(i,n),h=r(null),[b,E]=o(u),{refs:O,floatingStyles:D,context:M}=_e({open:b,middleware:[(S={element:h},{name:"arrow",options:S,fn(e){const{element:t,padding:n}="function"==typeof S?S(e):S;return t&&(r=t,{}.hasOwnProperty.call(r,"current"))?null!=t.current?U({element:t.current,padding:n}).fn(e):{}:t?U({element:t,padding:n}).fn(e):{};var r}}),Z(9),q()],onOpenChange:E,placement:"top"});var S;const A=function(t,n){var r;void 0===n&&(n={});const{open:o,floatingId:i}=t,{enabled:l=!0,role:c="dialog"}=n,s=null!=(r=Ie.get(c))?r:c,u=Ee(),a=null!=Ce();return e.useMemo((()=>{if(!l)return{};const e={id:i,...s&&{role:s}};return"tooltip"===s||"label"===c?{reference:{["aria-"+("label"===c?"labelledby":"describedby")]:o?i:void 0},floating:e}:{reference:{"aria-expanded":o?"true":"false","aria-haspopup":"alertdialog"===s?"dialog":s,"aria-controls":o?i:void 0,..."listbox"===s&&{role:"combobox"},..."menu"===s&&{id:u},..."menu"===s&&a&&{role:"menuitem"},..."select"===c&&{"aria-autocomplete":"none"},..."combobox"===c&&{"aria-autocomplete":"list"}},floating:{...e,..."menu"===s&&{"aria-labelledby":u}},item(e){let{active:t,selected:n}=e;const r={role:"option",...t&&{id:i+"-option"}};switch(c){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}}}}),[l,c,s,o,i,u,a])}(M),N=function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,nodeId:i,elements:{reference:l,domReference:c,floating:s},dataRef:u}=t,{enabled:a=!0,escapeKey:m=!0,outsidePress:p=!0,outsidePressEvent:g="pointerdown",referencePress:v=!1,referencePressEvent:h="pointerdown",ancestorScroll:b=!1,bubbles:E,capture:L}=n,O=ke(),D=ve("function"==typeof p?p:()=>!1),M="function"==typeof p?D:p,S=e.useRef(!1),A=e.useRef(!1),{escapeKey:N,outsidePress:F}=Fe(E),{escapeKey:W,outsidePress:_}=Fe(L),V=ve((e=>{if(!r||!a||!m||"Escape"!==e.key)return;const t=O?Se(O.nodesRef.current,i):[];if(!N&&(e.stopPropagation(),t.length>0)){let e=!0;if(t.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),B=ve((e=>{var t;const n=()=>{var t;V(e),null==(t=T(e))||t.removeEventListener("keydown",n)};null==(t=T(e))||t.addEventListener("keydown",n)})),H=ve((e=>{const t=S.current;S.current=!1;const n=A.current;if(A.current=!1,"click"===g&&n)return;if(t)return;if("function"==typeof M&&!M(e))return;const r=T(e),l="["+Te("inert")+"]",u=C(s).querySelectorAll(l);let a=f(r)?r:null;for(;a&&!y(a);){const e=x(a);if(y(e)||!f(e))break;a=e}if(u.length&&f(r)&&!r.matches("html,body")&&!P(r,s)&&Array.from(u).every((e=>!P(a,e))))return;if(d(r)&&s){const t=r.clientWidth>0&&r.scrollWidth>r.clientWidth,n=r.clientHeight>0&&r.scrollHeight>r.clientHeight;let o=n&&e.offsetX>r.clientWidth;if(n&&"rtl"===w(r).direction&&(o=e.offsetX<=r.offsetWidth-r.clientWidth),o||t&&e.offsetY>r.clientHeight)return}const m=O&&Se(O.nodesRef.current,i).some((t=>{var n;return k(e,null==(n=t.context)?void 0:n.elements.floating)}));if(k(e,s)||k(e,c)||m)return;const p=O?Se(O.nodesRef.current,i):[];if(p.length>0){let e=!0;if(p.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}o(!1,e,"outside-press")})),I=ve((e=>{var t;const n=()=>{var t;H(e),null==(t=T(e))||t.removeEventListener(g,n)};null==(t=T(e))||t.addEventListener(g,n)}));return e.useEffect((()=>{if(!r||!a)return;function e(e){o(!1,e,"ancestor-scroll")}u.current.__escapeKeyBubbles=N,u.current.__outsidePressBubbles=F;const t=C(s);m&&t.addEventListener("keydown",W?B:V,W),M&&t.addEventListener(g,_?I:H,_);let n=[];return b&&(f(c)&&(n=R(c)),f(s)&&(n=n.concat(R(s))),!f(l)&&l&&l.contextElement&&(n=n.concat(R(l.contextElement)))),n=n.filter((e=>{var n;return e!==(null==(n=t.defaultView)?void 0:n.visualViewport)})),n.forEach((t=>{t.addEventListener("scroll",e,{passive:!0})})),()=>{m&&t.removeEventListener("keydown",W?B:V,W),M&&t.removeEventListener(g,_?I:H,_),n.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[u,s,c,l,m,M,g,r,o,b,a,N,F,V,W,B,H,_,I]),e.useEffect((()=>{S.current=!1}),[M,g]),e.useMemo((()=>a?{reference:{onKeyDown:V,[Ae[h]]:e=>{v&&o(!1,e.nativeEvent,"reference-press")}},floating:{onKeyDown:V,onMouseDown(){A.current=!0},onMouseUp(){A.current=!0},[Ne[g]]:()=>{S.current=!0}}}:{}),[a,v,g,h,o,V])}(M),F=function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,dataRef:i,events:l,elements:{domReference:c,floating:s},refs:u}=t,{enabled:a=!0,delay:d=0,handleClose:m=null,mouseOnly:p=!1,restMs:g=0,move:v=!0}=n,h=ke(),y=Ce(),w=Oe(m),b=Oe(d),x=e.useRef(),E=e.useRef(),R=e.useRef(),k=e.useRef(),T=e.useRef(!0),O=e.useRef(!1),D=e.useRef((()=>{})),M=e.useCallback((()=>{var e;const t=null==(e=i.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[i]);e.useEffect((()=>{if(a)return l.on("openchange",e),()=>{l.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(E.current),clearTimeout(k.current),T.current=!0)}}),[a,l]),e.useEffect((()=>{if(!a||!w.current||!r)return;function e(e){M()&&o(!1,e,"hover")}const t=C(s).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[s,r,o,a,w,i,M]);const S=e.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const r=Me(b.current,"close",x.current);r&&!R.current?(clearTimeout(E.current),E.current=setTimeout((()=>o(!1,e,n)),r)):t&&(clearTimeout(E.current),o(!1,e,n))}),[b,o]),A=e.useCallback((()=>{D.current(),R.current=void 0}),[]),N=e.useCallback((()=>{if(O.current){const e=C(u.floating.current).body;e.style.pointerEvents="",e.removeAttribute(De),O.current=!1}}),[u]);return e.useEffect((()=>{if(a&&f(c)){const e=c;return r&&e.addEventListener("mouseleave",u),null==s||s.addEventListener("mouseleave",u),v&&e.addEventListener("mousemove",n,{once:!0}),e.addEventListener("mouseenter",n),e.addEventListener("mouseleave",l),()=>{r&&e.removeEventListener("mouseleave",u),null==s||s.removeEventListener("mouseleave",u),v&&e.removeEventListener("mousemove",n),e.removeEventListener("mouseenter",n),e.removeEventListener("mouseleave",l)}}function e(){return!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type)}function n(e){if(clearTimeout(E.current),T.current=!1,p&&!L(x.current)||g>0&&0===Me(b.current,"open"))return;const t=Me(b.current,"open",x.current);t?E.current=setTimeout((()=>{o(!0,e,"hover")}),t):o(!0,e,"hover")}function l(n){if(e())return;D.current();const o=C(s);if(clearTimeout(k.current),w.current){r||clearTimeout(E.current),R.current=w.current({...t,tree:h,x:n.clientX,y:n.clientY,onClose(){N(),A(),S(n,!0,"safe-polygon")}});const e=R.current;return o.addEventListener("mousemove",e),void(D.current=()=>{o.removeEventListener("mousemove",e)})}("touch"!==x.current||!P(s,n.relatedTarget))&&S(n)}function u(n){e()||null==w.current||w.current({...t,tree:h,x:n.clientX,y:n.clientY,onClose(){N(),A(),S(n)}})(n)}}),[c,s,a,t,p,g,v,S,A,N,o,r,h,b,w,i]),he((()=>{var e;if(a&&r&&null!=(e=w.current)&&e.__options.blockPointerEvents&&M()){const e=C(s).body;if(e.setAttribute(De,""),e.style.pointerEvents="none",O.current=!0,f(c)&&s){var t;const e=c,n=null==h||null==(t=h.nodesRef.current.find((e=>e.id===y)))||null==(t=t.context)?void 0:t.elements.floating;return n&&(n.style.pointerEvents=""),e.style.pointerEvents="auto",s.style.pointerEvents="auto",()=>{e.style.pointerEvents="",s.style.pointerEvents=""}}}}),[a,r,y,s,c,h,w,i,M]),he((()=>{r||(x.current=void 0,A(),N())}),[r,A,N]),e.useEffect((()=>()=>{A(),clearTimeout(E.current),clearTimeout(k.current),N()}),[a,c,A,N]),e.useMemo((()=>{if(!a)return{};function e(e){x.current=e.pointerType}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove(e){r||0===g||(clearTimeout(k.current),k.current=setTimeout((()=>{T.current||o(!0,e.nativeEvent,"hover")}),g))}},floating:{onMouseEnter(){clearTimeout(E.current)},onMouseLeave(e){S(e.nativeEvent,!1)}}}}),[a,g,r,o,S])}(M,{}),{getReferenceProps:W,getFloatingProps:_}=function(t){void 0===t&&(t=[]);const n=t,r=e.useCallback((e=>He(e,t,"reference")),n),o=e.useCallback((e=>He(e,t,"floating")),n),i=e.useCallback((e=>He(e,t,"item")),t.map((e=>null==e?void 0:e.item)));return e.useMemo((()=>({getReferenceProps:r,getFloatingProps:o,getItemProps:i})),[r,o,i])}([F,A,N]);return React.createElement(React.Fragment,null,React.createElement("span",l({className:`${v}-reference-element ${c}`,ref:O.setReference},W({onClick:()=>{console.log("click")}})),s),b&&React.createElement("div",l({className:`${v}-floating-element`,ref:O.setFloating,style:D},_()),m&&React.createElement(Re,{className:`rad-ui-arrow ${v}-arrow`,ref:h,context:M}),p))},$e=e=>{let{children:t,label:n,...r}=e;return React.createElement("div",null,React.createElement(je,l({popperName:"Tooltip",pop:"hello"},r),t))};export{$e as default};
|
package/package.json
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@radui/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
10
|
+
"clean": "rimraf dist",
|
|
10
11
|
"sb": "storybook dev -p 6006",
|
|
11
12
|
"patch": "npm version patch",
|
|
12
13
|
"storybook": "storybook dev -p 6006",
|
|
13
14
|
"build-storybook": "storybook build",
|
|
14
15
|
"build-css": "parcel build styles/themes/default.scss --out-dir dist/themes/main.css",
|
|
15
|
-
"build": "rollup -c",
|
|
16
|
+
"build": "npm run clean && npm run build-css && rollup -c",
|
|
16
17
|
"generate-tokens": "node ./scripts/tokenGen",
|
|
17
18
|
"publish": "npm publish --access public",
|
|
18
19
|
"lint": "eslint --ext .js,.jsx,.ts,.tsx . --fix"
|
|
@@ -58,9 +59,11 @@
|
|
|
58
59
|
"parcel-bundler": "^1.12.5",
|
|
59
60
|
"postcss": "^8.4.29",
|
|
60
61
|
"prop-types": "^15.8.1",
|
|
62
|
+
"rimraf": "^5.0.5",
|
|
61
63
|
"rollup": "^3.29.0",
|
|
62
64
|
"rollup-plugin-banner2": "^1.2.2",
|
|
63
65
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
66
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
64
67
|
"rollup-plugin-preserve-directives": "^0.2.0",
|
|
65
68
|
"sass-loader": "^13.3.2",
|
|
66
69
|
"storybook": "^7.4.0",
|