cynx-lib 1.3.89 → 1.3.90

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cynx-lib",
3
- "version": "1.3.89",
3
+ "version": "1.3.90",
4
4
  "type": "module",
5
5
  "main": "./index.cjs",
6
6
  "module": "./index.js",
@@ -39,8 +39,14 @@ export function ActionsMenu({ items, align = 'right' }) {
39
39
 
40
40
  menu.style.top = top + 'px';
41
41
  menu.style.left = left + 'px';
42
+ menu.style.transformOrigin = openUp
43
+ ? (align === 'left' ? 'bottom left' : 'bottom right')
44
+ : (align === 'left' ? 'top left' : 'top right');
42
45
  menu.classList.toggle('open-up', openUp);
43
- }, [align]);
46
+ if (!closing) {
47
+ menu.style.animationName = openUp ? 'actionsDropUp' : 'actionsDrop';
48
+ }
49
+ }, [align, closing]);
44
50
 
45
51
  useEffect(() => {
46
52
  if (!open) return;
@@ -104,6 +110,7 @@ export function ActionsMenu({ items, align = 'right' }) {
104
110
  background: 'var(--surface,#fff)', border: '1.5px solid var(--border-light,#e2e8f0)',
105
111
  borderRadius: 'var(--rads,8px)',
106
112
  boxShadow: 'var(--shadow-lg, 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.06))',
113
+ transformOrigin: align === 'left' ? 'top left' : 'top right',
107
114
  animation: closing
108
115
  ? 'actionsClose .14s ease forwards'
109
116
  : 'actionsDrop .14s cubic-bezier(.16,1,.3,1)',
@@ -145,12 +152,16 @@ export function ActionsMenu({ items, align = 'right' }) {
145
152
 
146
153
  <style>{`
147
154
  @keyframes actionsDrop {
148
- from { opacity: 0; transform: translateY(-6px) scaleY(.96); }
149
- to { opacity: 1; transform: translateY(0) scaleY(1); }
155
+ from { opacity: 0; transform: translateY(-6px); }
156
+ to { opacity: 1; transform: translateY(0); }
157
+ }
158
+ @keyframes actionsDropUp {
159
+ from { opacity: 0; transform: translateY(6px); }
160
+ to { opacity: 1; transform: translateY(0); }
150
161
  }
151
162
  @keyframes actionsClose {
152
- from { opacity: 1; transform: translateY(0) scaleY(1); }
153
- to { opacity: 0; transform: translateY(-4px) scaleY(.96); }
163
+ from { opacity: 1; transform: translateY(0); }
164
+ to { opacity: 0; transform: translateY(-4px); }
154
165
  }
155
166
  `}</style>
156
167
  </div>