Remove framer-motion for a link list add collapsible (#910)

## Description

1. What is this PR about (link the issue and add a short description)

Share list uses Collapsible instead of Framer motion

## Steps for reproduction

Click Share button, see expand of list items

## Code Review

- [ ] hi @kof, I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
  - test it on preview

## Before requesting a review

- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio-designer/blob/main/apps/designer/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `designer/env-check.js` if mandatory
This commit is contained in:
Ivan Starkov authored and GitHub committed 2023-02-01 13:24:25 +04:00
1 parent 8e5d0a2186
commit 47aa6d88be
3 files changed
+22 -123

No files matched your search

@@ -14,10 +14,11 @@ import {
theme,
Tooltip,
useId,
Collapsible,
keyframes,
} from "@webstudio-is/design-system";
import { CopyIcon, InfoIcon, MenuIcon, PlusIcon } from "@webstudio-is/icons";
import { Fragment, useState, type ComponentProps } from "react";
import { motion } from "framer-motion";
const Item = (props: ComponentProps<typeof Flex>) => (
<Flex
@@ -213,8 +214,21 @@ export type ShareProjectProps = {
designerUrl: SharedLinkItemType["designerUrl"];
};
const overflowHidden = css({
overflow: "hidden",
const animateCollapsibleHeight = keyframes({
"0%": {
height: 0,
overflow: "hidden",
opacity: 0,
},
"100%": {
height: "var(--radix-collapsible-content-height)",
overflow: "hidden",
opacity: 1,
},
});
const collapsibleStyle = css({
animation: `${animateCollapsibleHeight} 200ms ${theme.easing.easeOut}`,
});
export const ShareProject = ({
@@ -264,20 +278,12 @@ export const ShareProject = ({
width: theme.spacing[33],
}}
>
{items.length > 0 && (
<motion.div
className={overflowHidden()}
initial="collapsed"
animate="open"
variants={{
collapsed: { opacity: 0.0, height: 0 },
open: { opacity: 1, height: "auto" },
}}
transition={{ duration: 0.15 }}
>
<Collapsible.Root open={items.length > 0}>
<Collapsible.Content className={collapsibleStyle()}>
{items}
</motion.div>
)}
</Collapsible.Content>
</Collapsible.Root>
{create}
</Flex>
);
-1
View File
@@ -61,7 +61,6 @@
"djb2a": "^2.0.0",
"downshift": "^6.1.7",
"fast-deep-equal": "3.1.3",
"framer-motion": "^6.5.1",
"hyphenate-style-name": "^1.0.4",
"immer": "^9.0.12",
"immerhin": "^0.4.0",
-106
View File
@@ -116,7 +116,6 @@ importers:
downshift: ^6.1.7
esbuild-node-externals: ^1.4.1
fast-deep-equal: 3.1.3
framer-motion: ^6.5.1
hyphenate-style-name: ^1.0.4
immer: ^9.0.12
immerhin: ^0.4.0
@@ -201,7 +200,6 @@ importers:
djb2a: 2.0.0
downshift: 6.1.7_react@17.0.2
fast-deep-equal: 3.1.3
framer-motion: 6.5.1_sfoxds7t5ydpegc3knd667wn6m
hyphenate-style-name: 1.0.4
immer: 9.0.15
immerhin: 0.4.0
@@ -5365,19 +5363,6 @@ packages:
resolution: {integrity: sha512-14FtKiHhy2QoPIzdTcvh//8OyBlknNs2nXRwIhG904opCby3l+9Xaf/wuPvICBF0rc1ZCNBd3nKe9cd2mecVkQ==}
dev: true
/@emotion/is-prop-valid/0.8.8:
resolution: {integrity: sha512-u5WtneEAr5IDG2Wv65yhunPSMLIpuKsbuOktRojfrEiEvRyC85LgPMZI63cr7NUqT8ZIGdSVg8ZKGxIug4lXcA==}
requiresBuild: true
dependencies:
'@emotion/memoize': 0.7.4
dev: false
optional: true
/@emotion/memoize/0.7.4:
resolution: {integrity: sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw==}
dev: false
optional: true
/@esbuild-kit/cjs-loader/2.4.1:
resolution: {integrity: sha512-lhc/XLith28QdW0HpHZvZKkorWgmCNT7sVelMHDj3HFdTfdqkwEKvT+aXVQtNAmCC39VJhunDkWhONWB7335mg==}
dependencies:
@@ -6122,53 +6107,6 @@ packages:
/@mdx-js/util/1.6.22:
resolution: {integrity: sha512-H1rQc1ZOHANWBvPcW+JpGwr+juXSxM8Q8YCkm3GhZd8REu1fHR3z99CErO1p9pkcfcxZnMdIZdIsXkOHY0NilA==}
/@motionone/animation/10.15.1:
resolution: {integrity: sha512-mZcJxLjHor+bhcPuIFErMDNyrdb2vJur8lSfMCsuCB4UyV8ILZLvK+t+pg56erv8ud9xQGK/1OGPt10agPrCyQ==}
dependencies:
'@motionone/easing': 10.15.1
'@motionone/types': 10.15.1
'@motionone/utils': 10.15.1
tslib: 2.5.0
dev: false
/@motionone/dom/10.12.0:
resolution: {integrity: sha512-UdPTtLMAktHiqV0atOczNYyDd/d8Cf5fFsd1tua03PqTwwCe/6lwhLSQ8a7TbnQ5SN0gm44N1slBfj+ORIhrqw==}
dependencies:
'@motionone/animation': 10.15.1
'@motionone/generators': 10.15.1
'@motionone/types': 10.15.1
'@motionone/utils': 10.15.1
hey-listen: 1.0.8
tslib: 2.5.0
dev: false
/@motionone/easing/10.15.1:
resolution: {integrity: sha512-6hIHBSV+ZVehf9dcKZLT7p5PEKHGhDwky2k8RKkmOvUoYP3S+dXsKupyZpqx5apjd9f+php4vXk4LuS+ADsrWw==}
dependencies:
'@motionone/utils': 10.15.1
tslib: 2.5.0
dev: false
/@motionone/generators/10.15.1:
resolution: {integrity: sha512-67HLsvHJbw6cIbLA/o+gsm7h+6D4Sn7AUrB/GPxvujse1cGZ38F5H7DzoH7PhX+sjvtDnt2IhFYF2Zp1QTMKWQ==}
dependencies:
'@motionone/types': 10.15.1
'@motionone/utils': 10.15.1
tslib: 2.5.0
dev: false
/@motionone/types/10.15.1:
resolution: {integrity: sha512-iIUd/EgUsRZGrvW0jqdst8st7zKTzS9EsKkP+6c6n4MPZoQHwiHuVtTQLD6Kp0bsBLhNzKIBlHXponn/SDT4hA==}
dev: false
/@motionone/utils/10.15.1:
resolution: {integrity: sha512-p0YncgU+iklvYr/Dq4NobTRdAPv9PveRDUXabPEeOjBLSO/1FNB2phNTZxOxpi1/GZwYpAoECEa0Wam+nsmhSw==}
dependencies:
'@motionone/types': 10.15.1
hey-listen: 1.0.8
tslib: 2.5.0
dev: false
/@mrmlnc/readdir-enhanced/2.2.1:
resolution: {integrity: sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g==}
engines: {node: '>=4'}
@@ -15543,30 +15481,6 @@ packages:
dependencies:
map-cache: 0.2.2
/framer-motion/6.5.1_sfoxds7t5ydpegc3knd667wn6m:
resolution: {integrity: sha512-o1BGqqposwi7cgDrtg0dNONhkmPsUFDaLcKXigzuTFC5x58mE8iyTazxSudFzmT6MEyJKfjjU8ItoMe3W+3fiw==}
peerDependencies:
react: '>=16.8 || ^17.0.0 || ^18.0.0'
react-dom: '>=16.8 || ^17.0.0 || ^18.0.0'
dependencies:
'@motionone/dom': 10.12.0
framesync: 6.0.1
hey-listen: 1.0.8
popmotion: 11.0.3
react: 17.0.2
react-dom: 17.0.2_react@17.0.2
style-value-types: 5.0.0
tslib: 2.5.0
optionalDependencies:
'@emotion/is-prop-valid': 0.8.8
dev: false
/framesync/6.0.1:
resolution: {integrity: sha512-fUY88kXvGiIItgNC7wcTOl0SNRCVXMKSWW2Yzfmn7EKNc+MpCzcz9DhdHcdjbrtN3c6R4H5dTY2jiCpPdysEjA==}
dependencies:
tslib: 2.5.0
dev: false
/fresh/0.5.2:
resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==}
engines: {node: '>= 0.6'}
@@ -16176,10 +16090,6 @@ packages:
resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==}
hasBin: true
/hey-listen/1.0.8:
resolution: {integrity: sha512-COpmrF2NOg4TBWUJ5UVyaCU2A88wEMkUPK4hNqyCkqHbxT92BbvfjoSozkAIIm6XhicGlJHhFdullInrdhwU8Q==}
dev: false
/hmac-drbg/1.0.1:
resolution: {integrity: sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==}
dependencies:
@@ -19624,15 +19534,6 @@ packages:
engines: {node: '>=12.0.0'}
dev: false
/popmotion/11.0.3:
resolution: {integrity: sha512-Y55FLdj3UxkR7Vl3s7Qr4e9m0onSnP8W7d/xQLsoJM40vs6UKHFdygs6SWryasTZYqugMjm3BepCF4CWXDiHgA==}
dependencies:
framesync: 6.0.1
hey-listen: 1.0.8
style-value-types: 5.0.0
tslib: 2.5.0
dev: false
/posix-character-classes/0.1.1:
resolution: {integrity: sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg==}
engines: {node: '>=0.10.0'}
@@ -21904,13 +21805,6 @@ packages:
inline-style-parser: 0.1.1
dev: true
/style-value-types/5.0.0:
resolution: {integrity: sha512-08yq36Ikn4kx4YU6RD7jWEv27v4V+PUsOGa4n/as8Et3CuODMJQ00ENeAVXAeydX4Z2j1XHZF1K2sX4mGl18fA==}
dependencies:
hey-listen: 1.0.8
tslib: 2.5.0
dev: false
/stylis/4.1.1:
resolution: {integrity: sha512-lVrM/bNdhVX2OgBFNa2YJ9Lxj7kPzylieHd3TNjuGE0Re9JB7joL5VUKOVH1kdNNJTgGPpT8hmwIAPLaSyEVFQ==}
dev: false