@pickaxeproject/react 6.8.2 → 6.8.3
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/cjs/components/Core/Menu/List.js +1 -1
- package/dist/cjs/components/Core/Menu/Overflow.js +1 -1
- package/dist/cjs/components/Pickaxe/Form/Questions/Dropdown.js +1 -1
- package/dist/cjs/src/components/Core/Menu/List.d.ts +1 -0
- package/dist/esm/components/Core/Menu/List.js +1 -1
- package/dist/esm/components/Core/Menu/Overflow.js +1 -1
- package/dist/esm/components/Pickaxe/Form/Questions/Dropdown.js +1 -1
- package/dist/esm/src/components/Core/Menu/List.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),i=require("react"),r=require("./index.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),i=require("react"),r=require("./index.js"),n=require("react-tooltip"),s=require("../../../common/cn.js");const o=e=>`min(${e}, calc(100vw - 48px))`,l=i.forwardRef(((l,c)=>{var{children:a,width:d="200px",fixedWidth:u,matchAnchorWidth:h=!1,maxHeight:x,align:b="bottom-start",style:p,className:f}=l,m=e.__rest(l,["children","width","fixedWidth","matchAnchorWidth","maxHeight","align","style","className"]);const{id:g,isOpen:w,closeOnSelect:O,openOnClick:j,setIsOpen:v,onChange:y}=i.useContext(r.MenuContext),[C,k]=i.useState(null),q=h&&C?`${C}px`:void 0;return i.useEffect((()=>{if(!h||"undefined"==typeof window)return;const e=document.getElementById(g);if(!e)return;const t=()=>{const t=Math.ceil(e.getBoundingClientRect().width);k((e=>e===t?e:t))};t();const i=new ResizeObserver(t);return i.observe(e),window.addEventListener("resize",t),()=>{i.disconnect(),window.removeEventListener("resize",t)}}),[g,h]),t.jsx("div",{children:t.jsx(n.Tooltip,Object.assign({ref:c,anchorSelect:`#${g}`,place:b,positionStrategy:"fixed",style:Object.assign(Object.assign(Object.assign(Object.assign({fontFamily:"inherit",zIndex:1337,display:"flex",flexDirection:"column",padding:"0",backgroundColor:"white",color:"black",boxSizing:"border-box"},"auto"!==d&&!q&&{width:d,maxWidth:o(d)}),(q||u)&&{width:q||u,maxWidth:o(q||u||d)}),{borderRadius:"4px"}),p),clickable:!0,noArrow:!0,border:"1px solid rgba(0,0,0,.8)",opacity:1,isOpen:w,setIsOpen:y,openOnClick:j},m,{children:t.jsx("div",Object.assign({className:s.default("flex w-full select-none flex-col overflow-y-auto text-base shadow-lg scrollbar scrollbar-thumb-black/50 scrollbar-thumb-rounded-full scrollbar-w-[4px] scrollbar-h-[4px]",f),style:{maxHeight:x}},O&&{onClick:()=>v(!1)},{children:a}))}))})}));l.displayName="MenuList",exports.default=l;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),i=require("react-tooltip");const r=e=>`min(${e}, calc(100vw - 48px))`;exports.default=l=>{var{selector:o=".menuOverflow",align:c="bottom-start",width:a="200px",style:s,children:n,clickable:d=!1}=l,b=e.__rest(l,["selector","align","width","style","children","clickable"]);return t.jsx(i.Tooltip,Object.assign({anchorSelect:o,place:c,positionStrategy:"fixed",style:Object.assign(Object.assign(Object.assign({fontFamily:"inherit",zIndex:1337,display:"flex",flexDirection:"column",padding:"0",backgroundColor:"white",color:"black",boxSizing:"border-box"},"auto"!==a&&{width:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),i=require("react-tooltip");const r=e=>`min(${e}, calc(100vw - 48px))`;exports.default=l=>{var{selector:o=".menuOverflow",align:c="bottom-start",width:a="200px",style:s,children:n,clickable:d=!1}=l,b=e.__rest(l,["selector","align","width","style","children","clickable"]);return t.jsx(i.Tooltip,Object.assign({anchorSelect:o,place:c,positionStrategy:"fixed",style:Object.assign(Object.assign(Object.assign({fontFamily:"inherit",zIndex:1337,display:"flex",flexDirection:"column",padding:"0",backgroundColor:"white",color:"black",boxSizing:"border-box"},"auto"!==a&&{width:a,maxWidth:r(a)}),{borderRadius:"4px"}),s),clickable:d,noArrow:!0,opacity:1},b,{children:n}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("../../../../hooks/pickaxe/usePickaxeContext.js"),s=require("../../../../hooks/studio/useStyleInput.js"),t=require("../../../Core/Menu/index.js"),a=require("../../../Core/Menu/Button.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("../../../../hooks/pickaxe/usePickaxeContext.js"),s=require("../../../../hooks/studio/useStyleInput.js"),t=require("../../../Core/Menu/index.js"),a=require("../../../Core/Menu/Button.js"),o=require("../../../Core/Menu/List.js"),n=require("../../../../common/cn.js");exports.default=({id:i,children:l,placeholder:c,value:d,className:u,style:p,closeOnSelect:x=!0,maxToken:j=50,isDropdown:b=!1})=>{const{styles:g,colors:h}=r.usePickaxeContext(),m=s.useStyleInput(),f=Object.assign(Object.assign(Object.assign({},m),{borderRadius:g.cornerRadius}),p);return f.backgroundColor&&"transparent"!==f.backgroundColor||(f.backgroundColor=h.primary),b?e.jsxs(t.default,Object.assign({id:i,closeOnSelect:x,className:"relative"},{children:[e.jsx(a.default,Object.assign({variant:"anchor",className:n.default("flex items-center justify-between rounded-sm border border-transparent py-3 pl-4 pr-3 shadow duration-300",u,j<=50&&"max-w-[400px]"),style:Object.assign(Object.assign({},m),p)},{children:e.jsx("p",Object.assign({className:"line-clamp-1 select-none"},{children:(null!=d?d:"")||c}))})),e.jsx(o.default,Object.assign({className:"p-3 shadow-md",border:"#ffffff"===h.secondaryText.toLowerCase()?"1px solid rgba(255,255,255,0.7)":"1px solid rgba(0,0,0,0.7)",align:"bottom-end",width:j<=50?"400px":"auto",matchAnchorWidth:j>50,maxHeight:"200px",style:f},{children:l}))]})):e.jsx("div",{children:l})},exports.getDropdownMenuId=e=>{const r=e.trim().replace(/[^A-Za-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"");let s=0;for(let r=0;r<e.length;r+=1)s=31*s+e.charCodeAt(r)>>>0;return`pxe-dropdown-${r||"field"}-${s.toString(36)}`};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest as e}from"../../../_virtual/_tslib.js";import{jsx as
|
|
1
|
+
import{__rest as e}from"../../../_virtual/_tslib.js";import{jsx as t}from"react/jsx-runtime";import{forwardRef as i,useContext as n,useState as o,useEffect as r}from"react";import{MenuContext as l}from"./index.js";import{Tooltip as s}from"react-tooltip";import c from"../../../common/cn.js";const a=e=>`min(${e}, calc(100vw - 48px))`,d=i(((i,d)=>{var{children:m,width:h="200px",fixedWidth:b,matchAnchorWidth:p=!1,maxHeight:x,align:f="bottom-start",style:u,className:g}=i,w=e(i,["children","width","fixedWidth","matchAnchorWidth","maxHeight","align","style","className"]);const{id:O,isOpen:v,closeOnSelect:y,openOnClick:j,setIsOpen:k,onChange:C}=n(l),[W,z]=o(null),I=p&&W?`${W}px`:void 0;return r((()=>{if(!p||"undefined"==typeof window)return;const e=document.getElementById(O);if(!e)return;const t=()=>{const t=Math.ceil(e.getBoundingClientRect().width);z((e=>e===t?e:t))};t();const i=new ResizeObserver(t);return i.observe(e),window.addEventListener("resize",t),()=>{i.disconnect(),window.removeEventListener("resize",t)}}),[O,p]),t("div",{children:t(s,Object.assign({ref:d,anchorSelect:`#${O}`,place:f,positionStrategy:"fixed",style:Object.assign(Object.assign(Object.assign(Object.assign({fontFamily:"inherit",zIndex:1337,display:"flex",flexDirection:"column",padding:"0",backgroundColor:"white",color:"black",boxSizing:"border-box"},"auto"!==h&&!I&&{width:h,maxWidth:a(h)}),(I||b)&&{width:I||b,maxWidth:a(I||b||h)}),{borderRadius:"4px"}),u),clickable:!0,noArrow:!0,border:"1px solid rgba(0,0,0,.8)",opacity:1,isOpen:v,setIsOpen:C,openOnClick:j},w,{children:t("div",Object.assign({className:c("flex w-full select-none flex-col overflow-y-auto text-base shadow-lg scrollbar scrollbar-thumb-black/50 scrollbar-thumb-rounded-full scrollbar-w-[4px] scrollbar-h-[4px]",g),style:{maxHeight:x}},y&&{onClick:()=>k(!1)},{children:m}))}))})}));d.displayName="MenuList";export{d as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest as t}from"../../../_virtual/_tslib.js";import{jsx as i}from"react/jsx-runtime";import{Tooltip as e}from"react-tooltip";const o=t=>`min(${t}, calc(100vw - 48px))`,r=r=>{var{selector:l=".menuOverflow",align:a="bottom-start",width:c="200px",style:n,children:s,clickable:d=!1}=r,b=t(r,["selector","align","width","style","children","clickable"]);return i(e,Object.assign({anchorSelect:l,place:a,positionStrategy:"fixed",style:Object.assign(Object.assign(Object.assign({fontFamily:"inherit",zIndex:1337,display:"flex",flexDirection:"column",padding:"0",backgroundColor:"white",color:"black",boxSizing:"border-box"},"auto"!==c&&{width:
|
|
1
|
+
import{__rest as t}from"../../../_virtual/_tslib.js";import{jsx as i}from"react/jsx-runtime";import{Tooltip as e}from"react-tooltip";const o=t=>`min(${t}, calc(100vw - 48px))`,r=r=>{var{selector:l=".menuOverflow",align:a="bottom-start",width:c="200px",style:n,children:s,clickable:d=!1}=r,b=t(r,["selector","align","width","style","children","clickable"]);return i(e,Object.assign({anchorSelect:l,place:a,positionStrategy:"fixed",style:Object.assign(Object.assign(Object.assign({fontFamily:"inherit",zIndex:1337,display:"flex",flexDirection:"column",padding:"0",backgroundColor:"white",color:"black",boxSizing:"border-box"},"auto"!==c&&{width:c,maxWidth:o(c)}),{borderRadius:"4px"}),n),clickable:d,noArrow:!0,opacity:1},b,{children:s}))};export{r as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as r}from"react/jsx-runtime";import{usePickaxeContext as o}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useStyleInput as s}from"../../../../hooks/studio/useStyleInput.js";import t from"../../../Core/Menu/index.js";import n from"../../../Core/Menu/Button.js";import a from"../../../Core/Menu/List.js";import i from"../../../../common/cn.js";const c=e=>{const r=e.trim().replace(/[^A-Za-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"");let o=0;for(let r=0;r<e.length;r+=1)o=31*o+e.charCodeAt(r)>>>0;return`pxe-dropdown-${r||"field"}-${o.toString(36)}`},l=({id:c,children:l,placeholder:d,value:m,className:p,style:u,closeOnSelect:b=!0,maxToken:g=50,isDropdown:
|
|
1
|
+
import{jsx as e,jsxs as r}from"react/jsx-runtime";import{usePickaxeContext as o}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useStyleInput as s}from"../../../../hooks/studio/useStyleInput.js";import t from"../../../Core/Menu/index.js";import n from"../../../Core/Menu/Button.js";import a from"../../../Core/Menu/List.js";import i from"../../../../common/cn.js";const c=e=>{const r=e.trim().replace(/[^A-Za-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"");let o=0;for(let r=0;r<e.length;r+=1)o=31*o+e.charCodeAt(r)>>>0;return`pxe-dropdown-${r||"field"}-${o.toString(36)}`},l=({id:c,children:l,placeholder:d,value:m,className:p,style:u,closeOnSelect:b=!0,maxToken:g=50,isDropdown:h=!1})=>{const{styles:f,colors:j}=o(),x=s(),O=Object.assign(Object.assign(Object.assign({},x),{borderRadius:f.cornerRadius}),u);return O.backgroundColor&&"transparent"!==O.backgroundColor||(O.backgroundColor=j.primary),h?r(t,Object.assign({id:c,closeOnSelect:b,className:"relative"},{children:[e(n,Object.assign({variant:"anchor",className:i("flex items-center justify-between rounded-sm border border-transparent py-3 pl-4 pr-3 shadow duration-300",p,g<=50&&"max-w-[400px]"),style:Object.assign(Object.assign({},x),u)},{children:e("p",Object.assign({className:"line-clamp-1 select-none"},{children:(null!=m?m:"")||d}))})),e(a,Object.assign({className:"p-3 shadow-md",border:"#ffffff"===j.secondaryText.toLowerCase()?"1px solid rgba(255,255,255,0.7)":"1px solid rgba(0,0,0,0.7)",align:"bottom-end",width:g<=50?"400px":"auto",matchAnchorWidth:g>50,maxHeight:"200px",style:O},{children:l}))]})):e("div",{children:l})};export{l as default,c as getDropdownMenuId};
|