@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.
@@ -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"),l=require("react-tooltip"),s=require("../../../common/cn.js");const a=e=>`min(${e}, calc(100vw - 48px))`,o=i.forwardRef(((o,n)=>{var{children:c,width:d="200px",fixedWidth:x,maxHeight:b,align:u="bottom-start",style:h,className:p}=o,g=e.__rest(o,["children","width","fixedWidth","maxHeight","align","style","className"]);const{id:m,isOpen:f,closeOnSelect:j,openOnClick:O,setIsOpen:w,onChange:y}=i.useContext(r.MenuContext);return t.jsx("div",{children:t.jsx(l.Tooltip,Object.assign({ref:n,anchorSelect:`#${m}`,place:u,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&&{width:"100%",maxWidth:a(d)}),x&&{width:x,maxWidth:a(x)}),{borderRadius:"4px"}),h),clickable:!0,noArrow:!0,border:"1px solid rgba(0,0,0,.8)",opacity:1,isOpen:f,setIsOpen:y,openOnClick:O},g,{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]",p),style:{maxHeight:b}},j&&{onClick:()=>w(!1)},{children:c}))}))})}));o.displayName="MenuList",exports.default=o;
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:"100%",maxWidth:r(a)}),{borderRadius:"4px"}),s),clickable:d,noArrow:!0,opacity:1},b,{children:n}))};
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"),n=require("../../../Core/Menu/List.js"),o=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:m}=r.usePickaxeContext(),f=s.useStyleInput(),h=Object.assign(Object.assign(Object.assign({},f),{borderRadius:g.cornerRadius}),p);return h.backgroundColor&&"transparent"!==h.backgroundColor||(h.backgroundColor=m.primary),b?e.jsxs(t.default,Object.assign({id:i,closeOnSelect:x,className:"relative"},{children:[e.jsx(a.default,Object.assign({variant:"anchor",className:o.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({},f),p)},{children:e.jsx("p",Object.assign({className:"line-clamp-1 select-none"},{children:(null!=d?d:"")||c}))})),e.jsx(n.default,Object.assign({className:"p-3 shadow-md",border:"#ffffff"===m.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":"100%",maxHeight:"200px",style:h},{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
+ "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)}`};
@@ -3,6 +3,7 @@ import { type PlacesType, type ITooltip, type TooltipRefProps } from "react-tool
3
3
  interface MenuListProps extends ITooltip {
4
4
  width?: string;
5
5
  fixedWidth?: string;
6
+ matchAnchorWidth?: boolean;
6
7
  maxHeight?: string;
7
8
  align?: PlacesType;
8
9
  style?: CSSProperties;
@@ -1 +1 @@
1
- import{__rest as e}from"../../../_virtual/_tslib.js";import{jsx as i}from"react/jsx-runtime";import{forwardRef as t,useContext as l}from"react";import{MenuContext as o}from"./index.js";import{Tooltip as r}from"react-tooltip";import a from"../../../common/cn.js";const s=e=>`min(${e}, calc(100vw - 48px))`,n=t(((t,n)=>{var{children:c,width:d="200px",fixedWidth:m,maxHeight:b,align:p="bottom-start",style:x,className:h}=t,f=e(t,["children","width","fixedWidth","maxHeight","align","style","className"]);const{id:g,isOpen:u,closeOnSelect:O,openOnClick:w,setIsOpen:j,onChange:y}=l(o);return i("div",{children:i(r,Object.assign({ref:n,anchorSelect:`#${g}`,place:p,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&&{width:"100%",maxWidth:s(d)}),m&&{width:m,maxWidth:s(m)}),{borderRadius:"4px"}),x),clickable:!0,noArrow:!0,border:"1px solid rgba(0,0,0,.8)",opacity:1,isOpen:u,setIsOpen:y,openOnClick:w},f,{children:i("div",Object.assign({className:a("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]",h),style:{maxHeight:b}},O&&{onClick:()=>j(!1)},{children:c}))}))})}));n.displayName="MenuList";export{n as default};
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:"100%",maxWidth:o(c)}),{borderRadius:"4px"}),n),clickable:d,noArrow:!0,opacity:1},b,{children:s}))};export{r as default};
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:f=!1})=>{const{styles:j,colors:x}=o(),h=s(),O=Object.assign(Object.assign(Object.assign({},h),{borderRadius:j.cornerRadius}),u);return O.backgroundColor&&"transparent"!==O.backgroundColor||(O.backgroundColor=x.primary),f?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({},h),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"===x.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":"100%",maxHeight:"200px",style:O},{children:l}))]})):e("div",{children:l})};export{l as default,c as getDropdownMenuId};
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};
@@ -3,6 +3,7 @@ import { type PlacesType, type ITooltip, type TooltipRefProps } from "react-tool
3
3
  interface MenuListProps extends ITooltip {
4
4
  width?: string;
5
5
  fixedWidth?: string;
6
+ matchAnchorWidth?: boolean;
6
7
  maxHeight?: string;
7
8
  align?: PlacesType;
8
9
  style?: CSSProperties;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pickaxeproject/react",
3
- "version": "6.8.2",
3
+ "version": "6.8.3",
4
4
  "description": "Client utility library for Pickaxe",
5
5
  "repository": {
6
6
  "type": "git",