jattac.libs.web.overflow-menu 0.0.18 → 0.0.20

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/README.md CHANGED
@@ -8,10 +8,12 @@ This component provides a clean, modern, and accessible overflow menu suitable f
8
8
 
9
9
  ## Features
10
10
 
11
- - **Smooth Animations**: Built with Framer Motion for fluid, physics-based animations.
11
+ - **Smooth Animations**: Built with Framer Motion for fluid, physics-based animations, including a subtle wave animation and color change for the default icon.
12
12
  - **Staggered Item Display**: Menu items animate in with a subtle "waterfall" effect.
13
13
  - **Highly Customizable**: Easily change the trigger icon, menu item content, and functionality.
14
- - **Themable**: Uses CSS variables to allow for deep customization that can match any corporate branding.
14
+ - **Responsive Positioning**: Mobile-first design with desktop awareness, ensuring the menu positions correctly on various screen sizes and avoids cut-offs.
15
+ - **Enhanced Hover Effects**: Menu items feature modern background and foreground color changes on hover for clear visual feedback.
16
+ - **Item Separators**: Muted borders visually separate menu items, improving clarity and user experience.
15
17
  - **Portal Support**: Optionally render the menu in a React Portal to avoid CSS stacking context issues.
16
18
  - **Lightweight**: Simple and focused on providing a great overflow menu experience without unnecessary bloat.
17
19
 
@@ -25,8 +27,6 @@ npm install jattac.libs.web.overflow-menu react react-dom framer-motion
25
27
 
26
28
  ## Getting Started
27
29
 
28
-
29
-
30
30
  Here's a basic example to get you up and running quickly.
31
31
 
32
32
  ```jsx
@@ -128,53 +128,20 @@ const richMenuItems: IOverflowMenuItem[] = [
128
128
 
129
129
  ---
130
130
 
131
- ## Theming and Customization
131
+ ## Styling and Customization
132
132
 
133
- The component can be easily themed by overriding the default CSS variables. The variables are scoped to the `.menuWrapper` class, which is the root of the component.
133
+ The component's styling is primarily controlled via its internal CSS module (`OverflowMenu.module.css`). While direct customization through CSS variables is no longer supported, you can override the component's default styles by targeting its CSS classes in your own stylesheets.
134
134
 
135
- Here are the available variables and their default values:
135
+ For example, to change the background of the menu:
136
136
 
137
137
  ```css
138
- .your-custom-wrapper-class {
139
- --ofm-text-color: #024b59;
140
- --ofm-text-hover-color: #016a80;
141
- --ofm-bg: rgba(255, 255, 255, 0.75);
142
- --ofm-bg-blur: 12px;
143
- --ofm-border-radius: 12px;
144
- --ofm-item-border-radius: 8px;
145
- --ofm-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
146
- --ofm-border: 1px solid rgba(2, 75, 89, 0.15);
147
- --ofm-item-hover-bg: rgba(2, 75, 89, 0.05);
148
- --ofm-item-active-bg: rgba(2, 75, 89, 0.1);
138
+ /* In your application's CSS file */
139
+ .your-custom-wrapper-class .OverflowMenu-module_menu__n8uKD { /* Use the hashed class name from your build output */
140
+ background: #f0f0f0; /* Your desired background */
149
141
  }
150
142
  ```
151
-
152
- **Example: Creating a Dark Theme**
153
-
154
- To apply a dark theme, create a CSS class that overrides these variables and apply it to a parent element.
155
-
156
- *Your CSS file:*
157
- ```css
158
- .dark-theme {
159
- --ofm-text-color: #e0e0e0;
160
- --ofm-text-hover-color: #ffffff;
161
- --ofm-bg: rgba(40, 40, 40, 0.8);
162
- --ofm-border: 1px solid rgba(255, 255, 255, 0.1);
163
- --ofm-item-hover-bg: rgba(255, 255, 255, 0.1);
164
- --ofm-item-active-bg: rgba(255, 255, 255, 0.15);
165
- }
166
- ```
167
-
168
- *Your JSX file:*
169
- ```jsx
170
- import './your-styles.css';
171
-
172
- // ...
173
- <div className="dark-theme">
174
- <OverflowMenu items={menuItems} />
175
- </div>
176
- ```
143
+ *Note: The exact hashed class names (e.g., `OverflowMenu-module_menu__n8uKD`) will depend on your build process. You may need to inspect the rendered HTML to find them.*
177
144
 
178
145
  ## License
179
146
 
180
- This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
147
+ This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
@@ -1,10 +1,10 @@
1
- import React, { ReactNode } from 'react';
2
- import IOverflowMenuItem from '../Data/IOverflowMenuItem';
3
- interface IProps {
4
- icon?: ReactNode;
5
- portal?: HTMLElement;
6
- className?: string;
1
+ import React from 'react';
2
+ import { IOverflowMenuItem } from '../Data/IOverflowMenuItem';
3
+ interface OverflowMenuProps {
7
4
  items: IOverflowMenuItem[];
5
+ icon?: React.ReactNode;
6
+ className?: string;
7
+ portal?: HTMLElement;
8
8
  }
9
- declare const OverflowMenu: React.FC<IProps>;
9
+ declare const OverflowMenu: React.FC<OverflowMenuProps>;
10
10
  export default OverflowMenu;
package/dist/index.es.js CHANGED
@@ -1,2 +1,2 @@
1
- import e,{useState as t,useRef as n,useEffect as o,useLayoutEffect as r}from"react";import a from"react-dom";import{AnimatePresence as i,motion as l}from"framer-motion";var s="OverflowMenu-module_trigger__imdPK",u="OverflowMenu-module_menu__n8uKD",d="OverflowMenu-module_dotsWrapper__CHO9Q",c="OverflowMenu-module_dot__g5Rgi";!function(e,t){void 0===t&&(t={});var n=t.insertAt;if("undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}(".OverflowMenu-module_menuWrapper__psD7a{display:inline-block;position:relative;z-index:0}.OverflowMenu-module_trigger__imdPK{align-items:center;background:transparent;border:none;border-radius:50%;color:#024b59;cursor:pointer;display:flex;font-size:1.8rem;height:3rem;justify-content:center;transition:color .2s ease,background-color .2s ease;width:3rem}.OverflowMenu-module_trigger__imdPK:focus,.OverflowMenu-module_trigger__imdPK:hover{background-color:rgba(2,75,89,.05);color:#016a80;outline:none}.OverflowMenu-module_menu__n8uKD{backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);background:hsla(0,0%,100%,.75);border:1px solid #016a80;border-radius:12px;box-shadow:0 8px 24px rgba(0,0,0,.12);color:#024b59;display:flex;flex-direction:column;font-family:Segoe UI,Tahoma,Geneva,Verdana,sans-serif;font-weight:500;gap:.35rem;margin-top:.5rem;min-width:180px;padding:.5rem .25rem;position:absolute;right:0;top:100%;width:max-content;z-index:9999}.OverflowMenu-module_menu__n8uKD button{background:transparent;border:none;border-bottom:1px solid rgba(2,75,89,.1);border-radius:8px;color:#024b59;cursor:pointer;font-size:1rem;padding:.6rem 1rem;text-align:left;transition:background .25s ease,transform .12s ease;user-select:none}.OverflowMenu-module_menu__n8uKD button:last-child{border-bottom:none}.OverflowMenu-module_menu__n8uKD button:focus,.OverflowMenu-module_menu__n8uKD button:hover{background:rgba(2,75,89,.05);outline:none;transform:scale(1.03)}.OverflowMenu-module_menu__n8uKD button:active{background:rgba(2,75,89,.1);transform:scale(.98)}.OverflowMenu-module_dotsWrapper__CHO9Q{align-items:center;display:flex;flex-direction:column;gap:3px;justify-content:center}.OverflowMenu-module_dot__g5Rgi{background-color:currentColor;border-radius:50%;display:block;height:5px;width:5px}");const m={open:{opacity:1,y:0,transition:{type:"spring",stiffness:400,damping:40,staggerChildren:.07}},closed:{opacity:0,y:-10,transition:{duration:.2}}},p={open:{opacity:1,y:0,transition:{type:"spring",stiffness:300,damping:24}},closed:{opacity:0,y:10,transition:{duration:.2}}},f=({item:t,index:n,itemVariants:o,setOpen:r})=>e.createElement(l.button,{key:n,role:"menuitem",onClick:()=>{t.onClick&&t.onClick(),r(!1)},variants:o,whileHover:{backgroundColor:"rgba(0, 188, 212, 0.1)",color:"#024b59"},whileTap:{scale:.98,backgroundColor:"rgba(2, 75, 89, 0.1)"},transition:{duration:.1}},t.content),g=({open:t})=>e.createElement(l.div,{className:d},e.createElement(l.span,{className:c,animate:t?{x:[0,4,0],backgroundColor:"#00BCD4"}:{y:[0,-4,0],backgroundColor:"#024b59"},transition:{delay:0,duration:.3,ease:"easeInOut"},custom:0}),e.createElement(l.span,{className:c,animate:t?{x:[0,4,0],backgroundColor:"#00BCD4"}:{y:[0,-4,0],backgroundColor:"#024b59"},transition:{delay:.1,duration:.3,ease:"easeInOut"},custom:1}),e.createElement(l.span,{className:c,animate:t?{x:[0,4,0],backgroundColor:"#00BCD4"}:{y:[0,-4,0],backgroundColor:"#024b59"},transition:{delay:.2,duration:.3,ease:"easeInOut"},custom:2})),b=({icon:d="",portal:c,className:b,items:w})=>{const[v,_]=t(!1),y=n(null),h=n(null),[k,x]=t({top:0,left:0});o(()=>{const e=e=>{v&&y.current&&!y.current.contains(e.target)&&h.current&&!h.current.contains(e.target)&&_(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[v]),o(()=>{if(!v)return;const e=e=>{"Escape"===e.key&&_(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[v]),r(()=>{var e,t;if(v){if(!y.current||!h.current)return;const t=y.current.getBoundingClientRect(),n=h.current.offsetWidth,o=h.current.offsetHeight,r=window.innerWidth,a=window.innerHeight,i=768;let l=t.bottom+window.scrollY+4,s=0;if(t.bottom+o>a&&(l=t.top+window.scrollY-o-4),r<i)s=(r-n)/2+window.scrollX;else{let e=t.right+window.scrollX-160;s=e+n>r+window.scrollX?t.left+window.scrollX-n:e}x({top:l,left:s});const u=null===(e=h.current)||void 0===e?void 0:e.querySelector('[role="menuitem"]');null==u||u.focus()}else null===(t=y.current)||void 0===t||t.focus()},[v]);const C=e.createElement(i,null,v&&e.createElement(l.div,{ref:h,role:"menu",className:u,style:{position:"absolute",top:k.top,left:k.left},variants:m,initial:"closed",animate:"open",exit:"closed",onKeyDown:e=>{var t,n;if("ArrowUp"===e.key||"ArrowDown"===e.key){e.preventDefault();const o=Array.from(null===(t=h.current)||void 0===t?void 0:t.querySelectorAll('[role="menuitem"]')),r=o.findIndex(e=>e===document.activeElement);let a=-1;"ArrowDown"===e.key?a=(r+1)%o.length:"ArrowUp"===e.key&&(a=(r-1+o.length)%o.length),null===(n=o[a])||void 0===n||n.focus()}}},w.map((t,n)=>e.createElement(f,{key:n,item:t,index:n,itemVariants:p,setOpen:_}))));return e.createElement(e.Fragment,null,e.createElement("button",{ref:y,className:`${s} ${b}`,onClick:()=>_(!v),"aria-haspopup":"true","aria-expanded":v},e.createElement(l.div,{whileHover:{scale:1.2}},"⋮"===d?e.createElement(g,{open:v}):e.createElement(l.div,{animate:{rotate:v?90:0},transition:{type:"spring",stiffness:400,damping:40}},d))),c?a.createPortal(C,c):C)};export{b as default};
1
+ import e,{useState as o,useRef as n,useEffect as r}from"react";import{AnimatePresence as t,motion as i}from"framer-motion";import{createPortal as a}from"react-dom";var l={trigger:"OverflowMenu-module_trigger__imdPK",menu:"OverflowMenu-module_menu__n8uKD"};!function(e,o){void 0===o&&(o={});var n=o.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css","top"===n&&r.firstChild?r.insertBefore(t,r.firstChild):r.appendChild(t),t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}}(".OverflowMenu-module_menuWrapper__psD7a{display:inline-block;position:relative;z-index:0}.OverflowMenu-module_trigger__imdPK{align-items:center;background:transparent;border:none;border-radius:50%;color:#024b59;cursor:pointer;display:flex;font-size:1.8rem;height:3rem;justify-content:center;transition:color .2s ease,background-color .2s ease;width:3rem}.OverflowMenu-module_trigger__imdPK:focus,.OverflowMenu-module_trigger__imdPK:hover{background-color:rgba(2,75,89,.05);color:#016a80;outline:none}.OverflowMenu-module_menu__n8uKD{backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);background:hsla(0,0%,100%,.75);border:1px solid #016a80;border-radius:12px;box-shadow:0 8px 24px rgba(0,0,0,.12);color:#024b59;display:flex;flex-direction:column;font-family:Segoe UI,Tahoma,Geneva,Verdana,sans-serif;font-weight:500;gap:.35rem;margin-top:.5rem;min-width:180px;padding:.5rem .25rem;position:absolute;right:0;top:100%;width:max-content;z-index:9999}.OverflowMenu-module_menu__n8uKD button{background:transparent;border:none;border-bottom:1px solid rgba(2,75,89,.1);border-radius:8px;color:#024b59;cursor:pointer;font-size:1rem;padding:.6rem 1rem;text-align:left;transition:background .25s ease,transform .12s ease;user-select:none}.OverflowMenu-module_menu__n8uKD button:last-child{border-bottom:none}.OverflowMenu-module_menu__n8uKD button:focus,.OverflowMenu-module_menu__n8uKD button:hover{background:rgba(2,75,89,.05);outline:none;transform:scale(1.03)}.OverflowMenu-module_menu__n8uKD button:active{background:rgba(2,75,89,.1);transform:scale(.98)}.OverflowMenu-module_dotsWrapper__CHO9Q{align-items:center;display:flex;flex-direction:column;gap:3px;justify-content:center}.OverflowMenu-module_dot__g5Rgi{background-color:currentColor;border-radius:50%;display:block;height:5px;width:5px}");const d=({items:d,icon:u="",className:s="",portal:m=null})=>{const[c,p]=o(!1),f=n(null),b=n(null),g=e=>{f.current&&!f.current.contains(e.target)&&p(!1)};r(()=>(c?document.addEventListener("mousedown",g):document.removeEventListener("mousedown",g),()=>{document.removeEventListener("mousedown",g)}),[c]);const _={hidden:{opacity:0,y:-10},visible:{opacity:1,y:0}},v=e.createElement(t,{initial:!1},c&&e.createElement(i.div,{ref:f,className:l.menu,variants:{hidden:{opacity:0,scale:.95,transition:{duration:.1}},visible:{opacity:1,scale:1,transition:{duration:.2,staggerChildren:.05}}},initial:"hidden",animate:"visible",exit:"hidden"},d.map((o,n)=>e.createElement(i.button,{key:n,className:l.menuItem,onClick:()=>{var e;null===(e=o.onClick)||void 0===e||e.call(o),p(!1)},variants:_},o.content))));return e.createElement("div",{className:l.overflowMenu},e.createElement("button",{ref:b,onClick:e=>{e.stopPropagation(),p(!c)},className:`${l.trigger} ${s}`,"aria-haspopup":"true","aria-expanded":c},u),m?a(v,m):v)};export{d as default};
2
2
  //# sourceMappingURL=index.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es.js","sources":["../node_modules/style-inject/dist/style-inject.es.js","../src/UI/OverflowMenu.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n",null],"names":["css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","menuVariants","open","opacity","y","transition","stiffness","damping","staggerChildren","closed","duration","itemVariants","OverflowMenuItem","item","index","setOpen","React","motion","button","key","role","onClick","variants","whileHover","backgroundColor","color","whileTap","scale","content","DefaultIcon","div","className","styles","span","animate","x","delay","ease","custom","OverflowMenu","icon","portal","items","useState","triggerRef","useRef","menuRef","menuPos","setMenuPos","top","left","useEffect","handleClickOutside","event","current","contains","target","addEventListener","removeEventListener","handleEsc","useLayoutEffect","triggerRect","getBoundingClientRect","menuWidth","offsetWidth","menuHeight","offsetHeight","viewportWidth","window","innerWidth","viewportHeight","innerHeight","breakpoint","newTop","bottom","scrollY","newLeft","scrollX","desiredLeft","right","firstItem","_a","querySelector","focus","_b","menuContent","AnimatePresence","position","initial","exit","onKeyDown","e","preventDefault","Array","from","querySelectorAll","activeIndex","findIndex","activeElement","nextIndex","length","map","Fragment","rotate","ReactDOM","createPortal"],"mappings":"uUAAA,SAAqBA,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAgC,oBAAbC,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAKhCL,EAAKO,YAAYL,GAGfA,EAAMM,WACRN,EAAMM,WAAWC,QAAUb,EAE3BM,EAAMK,YAAYR,SAASW,eAAed,GAnBU,CAqBxD,gxDCXA,MAAMe,EAAyB,CAC7BC,K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KACEtF,EAAAvB,cAAA,SAAA,CACEN,IAAKyD,EACLb,UAAW,GAAGC,KAAkBD,IAChCV,QAAS,IAAMN,GAASb,GAAK,gBACf,OAAM,gBACLA,GAEfc,EAAAvB,cAACwB,EAAOa,IAAG,CAACP,WAAY,CAAEI,MAAO,MACrB,MAATa,EACCxB,EAAAvB,cAACoC,EAAW,CAAC3B,KAAMA,IAEnBc,EAAAvB,cAACwB,EAAOa,IAAG,CACTI,QAAS,CAAEqE,OAAQrG,EAAO,GAAK,GAC/BG,WAAY,CAAEX,KAAM,SAAUY,UAAW,IAAKC,QAAS,KAEtDiC,KAKRC,EAAS+D,EAASC,aAAapB,EAAa5C,GAAU4C","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.es.js","sources":["../node_modules/style-inject/dist/style-inject.es.js","../src/UI/OverflowMenu.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n",null],"names":["css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","OverflowMenu","items","icon","className","portal","isOpen","setIsOpen","useState","menuRef","useRef","triggerRef","handleClickOutside","event","current","contains","target","useEffect","addEventListener","removeEventListener","itemVariants","hidden","opacity","y","visible","menuContent","React","AnimatePresence","initial","motion","div","styles","menu","variants","scale","transition","duration","staggerChildren","animate","exit","map","item","index","button","key","menuItem","onClick","_a","call","content","overflowMenu","stopPropagation","trigger","createPortal"],"mappings":"iQAAA,SAAqBA,E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c,OAAM,CACVC,IAAKF,EACLtC,UAAW2B,EAAOc,SAClBC,QAAS,WACO,QAAZC,EAAAN,EAAKK,eAAO,IAAAC,GAAAA,EAAAC,KAAAP,GACZlC,GAAU,IAEd0B,SAAUb,GAETqB,EAAKQ,YAQ9B,OACIvB,EAAAjC,cAAA,MAAA,CAAKW,UAAW2B,EAAOmB,cACnBxB,EAAAjC,cAAA,SAAA,CACIN,IAAKwB,EACLmC,QA/EQjC,IAChBA,EAAMsC,kBACN5C,GAAWD,IA8EHF,UAAW,GAAG2B,EAAOqB,WAAWhD,IAAW,gBAC7B,OAAM,gBACLE,GAEdH,GAEJE,EAASgD,EAAa5B,EAAapB,GAAUoB","x_google_ignoreList":[0]}
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("react"),t=require("react-dom"),n=require("framer-motion");var o="OverflowMenu-module_trigger__imdPK",r="OverflowMenu-module_menu__n8uKD",i="OverflowMenu-module_dotsWrapper__CHO9Q",a="OverflowMenu-module_dot__g5Rgi";!function(e,t){void 0===t&&(t={});var n=t.insertAt;if("undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}(".OverflowMenu-module_menuWrapper__psD7a{display:inline-block;position:relative;z-index:0}.OverflowMenu-module_trigger__imdPK{align-items:center;background:transparent;border:none;border-radius:50%;color:#024b59;cursor:pointer;display:flex;font-size:1.8rem;height:3rem;justify-content:center;transition:color .2s ease,background-color .2s ease;width:3rem}.OverflowMenu-module_trigger__imdPK:focus,.OverflowMenu-module_trigger__imdPK:hover{background-color:rgba(2,75,89,.05);color:#016a80;outline:none}.OverflowMenu-module_menu__n8uKD{backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);background:hsla(0,0%,100%,.75);border:1px solid #016a80;border-radius:12px;box-shadow:0 8px 24px rgba(0,0,0,.12);color:#024b59;display:flex;flex-direction:column;font-family:Segoe UI,Tahoma,Geneva,Verdana,sans-serif;font-weight:500;gap:.35rem;margin-top:.5rem;min-width:180px;padding:.5rem .25rem;position:absolute;right:0;top:100%;width:max-content;z-index:9999}.OverflowMenu-module_menu__n8uKD button{background:transparent;border:none;border-bottom:1px solid rgba(2,75,89,.1);border-radius:8px;color:#024b59;cursor:pointer;font-size:1rem;padding:.6rem 1rem;text-align:left;transition:background .25s ease,transform .12s ease;user-select:none}.OverflowMenu-module_menu__n8uKD button:last-child{border-bottom:none}.OverflowMenu-module_menu__n8uKD button:focus,.OverflowMenu-module_menu__n8uKD button:hover{background:rgba(2,75,89,.05);outline:none;transform:scale(1.03)}.OverflowMenu-module_menu__n8uKD button:active{background:rgba(2,75,89,.1);transform:scale(.98)}.OverflowMenu-module_dotsWrapper__CHO9Q{align-items:center;display:flex;flex-direction:column;gap:3px;justify-content:center}.OverflowMenu-module_dot__g5Rgi{background-color:currentColor;border-radius:50%;display:block;height:5px;width:5px}");const l={open:{opacity:1,y:0,transition:{type:"spring",stiffness:400,damping:40,staggerChildren:.07}},closed:{opacity:0,y:-10,transition:{duration:.2}}},s={open:{opacity:1,y:0,transition:{type:"spring",stiffness:300,damping:24}},closed:{opacity:0,y:10,transition:{duration:.2}}},u=({item:t,index:o,itemVariants:r,setOpen:i})=>e.createElement(n.motion.button,{key:o,role:"menuitem",onClick:()=>{t.onClick&&t.onClick(),i(!1)},variants:r,whileHover:{backgroundColor:"rgba(0, 188, 212, 0.1)",color:"#024b59"},whileTap:{scale:.98,backgroundColor:"rgba(2, 75, 89, 0.1)"},transition:{duration:.1}},t.content),d=({open:t})=>e.createElement(n.motion.div,{className:i},e.createElement(n.motion.span,{className:a,animate:t?{x:[0,4,0],backgroundColor:"#00BCD4"}:{y:[0,-4,0],backgroundColor:"#024b59"},transition:{delay:0,duration:.3,ease:"easeInOut"},custom:0}),e.createElement(n.motion.span,{className:a,animate:t?{x:[0,4,0],backgroundColor:"#00BCD4"}:{y:[0,-4,0],backgroundColor:"#024b59"},transition:{delay:.1,duration:.3,ease:"easeInOut"},custom:1}),e.createElement(n.motion.span,{className:a,animate:t?{x:[0,4,0],backgroundColor:"#00BCD4"}:{y:[0,-4,0],backgroundColor:"#024b59"},transition:{delay:.2,duration:.3,ease:"easeInOut"},custom:2}));module.exports=({icon:i="",portal:a,className:c,items:m})=>{const[p,f]=e.useState(!1),g=e.useRef(null),b=e.useRef(null),[w,v]=e.useState({top:0,left:0});e.useEffect(()=>{const e=e=>{p&&g.current&&!g.current.contains(e.target)&&b.current&&!b.current.contains(e.target)&&f(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[p]),e.useEffect(()=>{if(!p)return;const e=e=>{"Escape"===e.key&&f(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[p]),e.useLayoutEffect(()=>{var e,t;if(p){if(!g.current||!b.current)return;const t=g.current.getBoundingClientRect(),n=b.current.offsetWidth,o=b.current.offsetHeight,r=window.innerWidth,i=window.innerHeight,a=768;let l=t.bottom+window.scrollY+4,s=0;if(t.bottom+o>i&&(l=t.top+window.scrollY-o-4),r<a)s=(r-n)/2+window.scrollX;else{let e=t.right+window.scrollX-160;s=e+n>r+window.scrollX?t.left+window.scrollX-n:e}v({top:l,left:s});const u=null===(e=b.current)||void 0===e?void 0:e.querySelector('[role="menuitem"]');null==u||u.focus()}else null===(t=g.current)||void 0===t||t.focus()},[p]);const _=e.createElement(n.AnimatePresence,null,p&&e.createElement(n.motion.div,{ref:b,role:"menu",className:r,style:{position:"absolute",top:w.top,left:w.left},variants:l,initial:"closed",animate:"open",exit:"closed",onKeyDown:e=>{var t,n;if("ArrowUp"===e.key||"ArrowDown"===e.key){e.preventDefault();const o=Array.from(null===(t=b.current)||void 0===t?void 0:t.querySelectorAll('[role="menuitem"]')),r=o.findIndex(e=>e===document.activeElement);let i=-1;"ArrowDown"===e.key?i=(r+1)%o.length:"ArrowUp"===e.key&&(i=(r-1+o.length)%o.length),null===(n=o[i])||void 0===n||n.focus()}}},m.map((t,n)=>e.createElement(u,{key:n,item:t,index:n,itemVariants:s,setOpen:f}))));return e.createElement(e.Fragment,null,e.createElement("button",{ref:g,className:`${o} ${c}`,onClick:()=>f(!p),"aria-haspopup":"true","aria-expanded":p},e.createElement(n.motion.div,{whileHover:{scale:1.2}},"⋮"===i?e.createElement(d,{open:p}):e.createElement(n.motion.div,{animate:{rotate:p?90:0},transition:{type:"spring",stiffness:400,damping:40}},i))),a?t.createPortal(_,a):_)};
1
+ "use strict";var e=require("react"),r=require("framer-motion"),n=require("react-dom");var o={trigger:"OverflowMenu-module_trigger__imdPK",menu:"OverflowMenu-module_menu__n8uKD"};!function(e,r){void 0===r&&(r={});var n=r.insertAt;if("undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css","top"===n&&o.firstChild?o.insertBefore(t,o.firstChild):o.appendChild(t),t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}}(".OverflowMenu-module_menuWrapper__psD7a{display:inline-block;position:relative;z-index:0}.OverflowMenu-module_trigger__imdPK{align-items:center;background:transparent;border:none;border-radius:50%;color:#024b59;cursor:pointer;display:flex;font-size:1.8rem;height:3rem;justify-content:center;transition:color .2s ease,background-color .2s ease;width:3rem}.OverflowMenu-module_trigger__imdPK:focus,.OverflowMenu-module_trigger__imdPK:hover{background-color:rgba(2,75,89,.05);color:#016a80;outline:none}.OverflowMenu-module_menu__n8uKD{backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);background:hsla(0,0%,100%,.75);border:1px solid #016a80;border-radius:12px;box-shadow:0 8px 24px rgba(0,0,0,.12);color:#024b59;display:flex;flex-direction:column;font-family:Segoe UI,Tahoma,Geneva,Verdana,sans-serif;font-weight:500;gap:.35rem;margin-top:.5rem;min-width:180px;padding:.5rem .25rem;position:absolute;right:0;top:100%;width:max-content;z-index:9999}.OverflowMenu-module_menu__n8uKD button{background:transparent;border:none;border-bottom:1px solid rgba(2,75,89,.1);border-radius:8px;color:#024b59;cursor:pointer;font-size:1rem;padding:.6rem 1rem;text-align:left;transition:background .25s ease,transform .12s ease;user-select:none}.OverflowMenu-module_menu__n8uKD button:last-child{border-bottom:none}.OverflowMenu-module_menu__n8uKD button:focus,.OverflowMenu-module_menu__n8uKD button:hover{background:rgba(2,75,89,.05);outline:none;transform:scale(1.03)}.OverflowMenu-module_menu__n8uKD button:active{background:rgba(2,75,89,.1);transform:scale(.98)}.OverflowMenu-module_dotsWrapper__CHO9Q{align-items:center;display:flex;flex-direction:column;gap:3px;justify-content:center}.OverflowMenu-module_dot__g5Rgi{background-color:currentColor;border-radius:50%;display:block;height:5px;width:5px}");module.exports=({items:t,icon:i="",className:a="",portal:l=null})=>{const[u,d]=e.useState(!1),s=e.useRef(null),m=e.useRef(null),c=e=>{s.current&&!s.current.contains(e.target)&&d(!1)};e.useEffect(()=>(u?document.addEventListener("mousedown",c):document.removeEventListener("mousedown",c),()=>{document.removeEventListener("mousedown",c)}),[u]);const p={hidden:{opacity:0,y:-10},visible:{opacity:1,y:0}},f=e.createElement(r.AnimatePresence,{initial:!1},u&&e.createElement(r.motion.div,{ref:s,className:o.menu,variants:{hidden:{opacity:0,scale:.95,transition:{duration:.1}},visible:{opacity:1,scale:1,transition:{duration:.2,staggerChildren:.05}}},initial:"hidden",animate:"visible",exit:"hidden"},t.map((n,t)=>e.createElement(r.motion.button,{key:t,className:o.menuItem,onClick:()=>{var e;null===(e=n.onClick)||void 0===e||e.call(n),d(!1)},variants:p},n.content))));return e.createElement("div",{className:o.overflowMenu},e.createElement("button",{ref:m,onClick:e=>{e.stopPropagation(),d(!u)},className:`${o.trigger} ${a}`,"aria-haspopup":"true","aria-expanded":u},i),l?n.createPortal(f,l):f)};
2
2
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../node_modules/style-inject/dist/style-inject.es.js","../src/UI/OverflowMenu.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n",null],"names":["css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","menuVariants","open","opacity","y","transition","stiffness","damping","staggerChildren","closed","duration","itemVariants","OverflowMenuItem","item","index","setOpen","React","motion","button","key","role","onClick","variants","whileHover","backgroundColor","color","whileTap","scale","content","DefaultIcon","div","className","styles","span","animate","x","delay","ease","custom","icon","portal","items","useState","triggerRef","useRef","menuRef","menuPos","setMenuPos","top","left","useEffect","handleClickOutside","event","current","contains","target","addEventListener","removeEventListener","handleEsc","useLayoutEffect","triggerRect","getBoundingClientRect","menuWidth","offsetWidth","menuHeight","offsetHeight","viewportWidth","window","innerWidth","viewportHeight","innerHeight","breakpoint","newTop","bottom","scrollY","newLeft","scrollX","desiredLeft","right","firstItem","_a","querySelector","focus","_b","menuContent","AnimatePresence","position","initial","exit","onKeyDown","e","preventDefault","Array","from","querySelectorAll","activeIndex","findIndex","activeElement","nextIndex","length","map","Fragment","rotate","ReactDOM","createPortal"],"mappings":"oPAAA,SAAqBA,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAgC,oBAAbC,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,W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ACnB,YAAVT,EAAEvE,MACX+E,GAAaH,EAAc,EAAItD,EAAM0D,QAAU1D,EAAM0D,QAGvC,QAAhBhB,EAAA1C,EAAMyD,UAAU,IAAAf,GAAAA,EAAED,WAkBbzC,EAAM2D,IAAI,CAACvF,EAAMC,IAChBE,EAAAvB,cAACmB,GACCO,IAAKL,EACLD,KAAMA,EACNC,MAAOA,EACPH,aAAcA,EACdI,QAASA,OAQrB,OACEC,EAAAvB,cAAAuB,EAAAqF,SAAA,KACErF,EAAAvB,cAAA,SAAA,CACEN,IAAKwD,EACLZ,UAAW,GAAGC,KAAkBD,IAChCV,QAAS,IAAMN,GAASb,GAAK,gBACf,OAAM,gBACLA,GAEfc,EAAAvB,cAACwB,EAAAA,OAAOa,IAAG,CAACP,WAAY,CAAEI,MAAO,MACrB,MAATY,EACCvB,EAAAvB,cAACoC,EAAW,CAAC3B,KAAMA,IAEnBc,EAAAvB,cAACwB,EAAAA,OAAOa,IAAG,CACTI,QAAS,CAAEoE,OAAQpG,EAAO,GAAK,GAC/BG,WAAY,CAAEX,KAAM,SAAUY,UAAW,IAAKC,QAAS,KAEtDgC,KAKRC,EAAS+D,EAASC,aAAapB,EAAa5C,GAAU4C","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.js","sources":["../node_modules/style-inject/dist/style-inject.es.js","../src/UI/OverflowMenu.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n",null],"names":["css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","items","icon","className","portal","isOpen","setIsOpen","useState","menuRef","useRef","triggerRef","handleClickOutside","event","current","contains","target","useEffect","addEventListener","removeEventListener","itemVariants","hidden","opacity","y","visible","menuContent","React","AnimatePresence","initial","motion","div","styles","menu","variants","scale","transition","duration","staggerChildren","animate","exit","map","item","index","button","key","menuItem","onClick","_a","call","content","overflowMenu","stopPropagation","trigger","createPortal"],"mappings":"mLAAA,SAAqBA,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAgC,oBAAbC,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAKhCL,EAAKO,YAAYL,GAGfA,EAAMM,WACRN,EAAMM,WAAWC,QAAUb,EAE3BM,EAAMK,YAAYR,SAASW,eAAed,GAnBU,CAqBxD,+xDCZkD,EAC9Ce,QACAC,OAAO,IACPC,YAAY,GACZC,SAAS,SAET,MAAOC,EAAQC,GAAaC,EAAAA,UAAS,GAC/BC,EAAUC,EAAAA,OAAuB,MACjCC,EAAaD,EAAAA,OAA0B,MAOvCE,EAAsBC,IACpBJ,EAAQK,UAAYL,EAAQK,QAAQC,SAASF,EAAMG,SACnDT,GAAU,IAIlBU,EAAAA,UAAU,KACFX,EACAhB,SAAS4B,iBAAiB,YAAaN,GAEvCtB,SAAS6B,oBAAoB,YAAaP,GAGvC,KACHtB,SAAS6B,oBAAoB,YAAaP,KAE/C,CAACN,IAEJ,MAkBMc,EAAe,CACjBC,OAAQ,CAAEC,QAAS,EAAGC,GAAG,IACzBC,QAAS,CAAEF,QAAS,EAAGC,EAAG,IAGxBE,EACFC,EAAAhC,cAACiC,EAAAA,gBAAe,CAACC,SAAS,GACrBtB,GACGoB,EAAAhC,cAACmC,SAAOC,IAAG,CACP1C,IAAKqB,EACLL,UAAW2B,EAAOC,KAClBC,SA7BK,CACjBZ,OAAQ,CACJC,QAAS,EACTY,MAAO,IACPC,WAAY,CACRC,SAAU,KAGlBZ,QAAS,CACLF,QAAS,EACTY,MAAO,EACPC,WAAY,CACRC,SAAU,GACVC,gBAAiB,OAiBbT,QAAQ,SACRU,QAAQ,UACRC,KAAK,UAEJrC,EAAMsC,IAAI,CAACC,EAAMC,IACdhB,EAAAhC,cAACmC,EAAAA,OAAOc,OAAM,CACVC,IAAKF,EACLtC,UAAW2B,EAAOc,SAClBC,QAAS,WACO,QAAZC,EAAAN,EAAKK,eAAO,IAAAC,GAAAA,EAAAC,KAAAP,GACZlC,GAAU,IAEd0B,SAAUb,GAETqB,EAAKQ,YAQ9B,OACIvB,EAAAhC,cAAA,MAAA,CAAKU,UAAW2B,EAAOmB,cACnBxB,EAAAhC,cAAA,SAAA,CACIN,IAAKuB,EACLmC,QA/EQjC,IAChBA,EAAMsC,kBACN5C,GAAWD,IA8EHF,UAAW,GAAG2B,EAAOqB,WAAWhD,IAAW,gBAC7B,OAAM,gBACLE,GAEdH,GAEJE,EAASgD,EAAAA,aAAa5B,EAAapB,GAAUoB","x_google_ignoreList":[0]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jattac.libs.web.overflow-menu",
3
- "version": "0.0.18",
3
+ "version": "0.0.20",
4
4
  "description": "A customizable and lightweight React overflow menu component with a modern design.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",