Skip to content

Commit de51ea4

Browse files
committed
Update demo
1 parent fb6d34a commit de51ea4

File tree

3 files changed

+33
-14
lines changed

3 files changed

+33
-14
lines changed

demo/package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
{
22
"name": "react-floater-demo",
3-
"version": "0.9.4",
3+
"version": "1.0.0",
44
"dependencies": {
5-
"@emotion/react": "^11.13.3",
6-
"@emotion/styled": "^11.13.0",
7-
"@gilbarbara/components": "^0.14.1",
8-
"@gilbarbara/eslint-config": "^0.8.1",
9-
"@gilbarbara/hooks": "^0.8.2",
5+
"@emotion/react": "^11.14.0",
6+
"@emotion/styled": "^11.14.0",
7+
"@gilbarbara/components": "^0.15.4",
8+
"@gilbarbara/eslint-config": "^0.8.8",
9+
"@gilbarbara/hooks": "^0.10.4",
1010
"@gilbarbara/prettier-config": "^1.0.0",
1111
"disable-scroll": "^0.6.0",
12-
"prettier": "^3.3.3",
12+
"prettier": "^3.5.3",
1313
"react": "^18.3.1",
1414
"react-dom": "^18.3.1",
1515
"react-floater": "latest",
1616
"react-scripts": "5.0.1",
17-
"typescript": "^5.5.4"
17+
"typescript": "^5.8.3"
1818
},
1919
"devDependencies": {
20-
"@types/node": "^20.11.30",
21-
"@types/react": "^18.3.5",
22-
"@types/react-dom": "^18.3.0"
20+
"@types/node": "^22.15.21",
21+
"@types/react": "^18.3.22",
22+
"@types/react-dom": "^18.3.7"
2323
},
2424
"scripts": {
2525
"start": "react-scripts start",

demo/src/examples/Target.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default React.forwardRef<HTMLDivElement, any>(({ onMount }, ref) => {
88
}, [onMount]);
99

1010
return (
11-
<div ref={ref} className="target">
11+
<div ref={ref} className="target" style={{ height: 64, width: 64, margin: '0 auto' }}>
1212
<Floater content="I have a click event to my repo!" event="hover" placement="top">
1313
<Anchor
1414
display="inline-flex"

demo/src/examples/WithStyledComponents.tsx

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Floater, { CustomComponentProps } from 'react-floater';
1+
import Floater, { CustomComponentProps } from 'react-floater';
22
import styled from '@emotion/styled';
33
import { Button } from '@gilbarbara/components';
44

@@ -36,14 +36,33 @@ export default function WithStyledComponents({ cb }: any) {
3636
return (
3737
<Column>
3838
<Floater
39+
arrow={
40+
<svg
41+
height="100px"
42+
version="1.1"
43+
viewBox="0 0 10 100"
44+
width="10px"
45+
xmlns="http://www.w3.org/2000/svg"
46+
transform="rotate(180)"
47+
>
48+
<g>
49+
<path
50+
d="M5.19249228e-07,5.16768813 C0.000571745188,2.3180242 2.3238984,6.52762368e-06 5.17356233,6.52762368e-06 C7.4961469,-0.00369898343 9.46628897,1.57062447 10.1275925,3.67813093 C11.5918888,8.26905035 5.18127186,100.000007 5.18127186,100.000007 L1.9635443,41.3615605 C0.907405183,22.0686414 -0.000792731847,5.40502691 5.19249228e-07,5.16768813 Z M5.18507488,2.58554059 C3.75638551,2.5874823 2.59249512,3.74291582 2.59443184,5.17160518 C2.59160462,6.52075954 3.7928988,13.3574741 4.95859452,14.5045202 C6.56709198,13.5758538 7.69207267,4.78979882 7.69207267,4.78979882 C7.50203478,3.55199808 6.48229278,2.58749911 5.18507488,2.58554059 Z"
51+
fill="currentColor"
52+
/>
53+
</g>
54+
</svg>
55+
}
3956
callback={cb}
4057
component={CustomFloater}
4158
disableFlip
4259
placement="bottom-start"
4360
portalElement="#portalElement"
4461
styles={{
4562
arrow: {
46-
color: '#9ec2ff',
63+
length: 80,
64+
spread: 10,
65+
color: '#6ba2ff',
4766
},
4867
}}
4968
>

0 commit comments

Comments
 (0)