lines-overlay 0.1.16 → 0.1.18
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/components/config-button.tsx +89 -60
- package/components/config-options.tsx +96 -19
- package/components/data.ts +1 -1
- package/components/move-lines-button.tsx +17 -10
- package/dist/components/config-button.js +36 -8
- package/dist/components/config-options.js +87 -9
- package/dist/components/data.js +1 -1
- package/dist/components/move-lines-button.js +15 -7
- package/dist/lines-overlay.js +32 -24
- package/dist/ui/button.d.ts +16 -9
- package/dist/ui/button.js +80 -62
- package/dist/ui/buttons-wrapper.js +10 -2
- package/dist/ui/lucide-icon.js +11 -3
- package/dist/ui/separator.d.ts +4 -2
- package/dist/ui/separator.js +25 -4
- package/index.css +0 -0
- package/lines-overlay.tsx +44 -37
- package/package.json +1 -6
- package/ui/button.tsx +128 -94
- package/ui/buttons-wrapper.tsx +12 -7
- package/ui/lucide-icon.tsx +12 -3
- package/ui/separator.tsx +44 -22
|
@@ -1,60 +1,89 @@
|
|
|
1
|
-
import { ChevronDown, ChevronUp, X } from 'lucide-react';
|
|
2
|
-
import { MouseEvent } from 'react';
|
|
3
|
-
import { StateSetter } from '../types';
|
|
4
|
-
import { Button, Icon, Separator } from '../ui/index';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
1
|
+
import { ChevronDown, ChevronUp, X } from 'lucide-react';
|
|
2
|
+
import { MouseEvent } from 'react';
|
|
3
|
+
import { StateSetter } from '../types';
|
|
4
|
+
import { Button, Icon, Separator } from '../ui/index';
|
|
5
|
+
|
|
6
|
+
const css = {
|
|
7
|
+
container: {
|
|
8
|
+
position: 'fixed',
|
|
9
|
+
bottom: 8,
|
|
10
|
+
right: 8,
|
|
11
|
+
zIndex: 9999,
|
|
12
|
+
pointerEvents: 'auto',
|
|
13
|
+
height: 40,
|
|
14
|
+
borderWidth: 1,
|
|
15
|
+
borderStyle: 'solid',
|
|
16
|
+
borderColor: 'rgba(148,163,184,0.8)',
|
|
17
|
+
backgroundColor: 'rgba(255,255,255,0.70)',
|
|
18
|
+
boxShadow: '0 1px 3px rgba(15,23,42,0.2)',
|
|
19
|
+
display: 'flex',
|
|
20
|
+
alignItems: 'center',
|
|
21
|
+
paddingLeft: 14,
|
|
22
|
+
paddingRight: 4,
|
|
23
|
+
},
|
|
24
|
+
label: {
|
|
25
|
+
fontWeight: 500,
|
|
26
|
+
fontSize: '0.8125rem',
|
|
27
|
+
letterSpacing: '0.03em',
|
|
28
|
+
paddingRight: 8,
|
|
29
|
+
},
|
|
30
|
+
buttonsRow: {
|
|
31
|
+
height: '100%',
|
|
32
|
+
display: 'flex',
|
|
33
|
+
alignItems: 'center',
|
|
34
|
+
gap: 4,
|
|
35
|
+
},
|
|
36
|
+
closeIcon: {
|
|
37
|
+
color: '#dc2626',
|
|
38
|
+
},
|
|
39
|
+
} as const;
|
|
40
|
+
|
|
41
|
+
export function ConfigButton({
|
|
42
|
+
onToggleConfig,
|
|
43
|
+
open,
|
|
44
|
+
setShow,
|
|
45
|
+
}: {
|
|
46
|
+
open: boolean;
|
|
47
|
+
onToggleConfig: () => void;
|
|
48
|
+
setShow: StateSetter<boolean>;
|
|
49
|
+
}) {
|
|
50
|
+
const handleClick = (e: MouseEvent<HTMLButtonElement>, item: number) => {
|
|
51
|
+
if (item === 1) {
|
|
52
|
+
onToggleConfig();
|
|
53
|
+
} else {
|
|
54
|
+
e.stopPropagation();
|
|
55
|
+
setShow((v) => !v);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<div style={css.container}>
|
|
61
|
+
<span style={css.label}>
|
|
62
|
+
Configurar
|
|
63
|
+
</span>
|
|
64
|
+
|
|
65
|
+
<div style={css.buttonsRow}>
|
|
66
|
+
{[1, 2, 3].map((item) =>
|
|
67
|
+
item !== 2 ? (
|
|
68
|
+
<Button
|
|
69
|
+
variant={'transparent'}
|
|
70
|
+
size="icon-sm"
|
|
71
|
+
data-black
|
|
72
|
+
key={item}
|
|
73
|
+
onClick={(e) => {
|
|
74
|
+
handleClick(e, item);
|
|
75
|
+
}}>
|
|
76
|
+
{item === 1 ? (
|
|
77
|
+
<Icon Icon={open ? ChevronDown : ChevronUp} size={'xl'} strokeWidth="light" />
|
|
78
|
+
) : (
|
|
79
|
+
<Icon Icon={X} size="sm" strokeWidth="light" className={undefined} />
|
|
80
|
+
)}
|
|
81
|
+
</Button>
|
|
82
|
+
) : (
|
|
83
|
+
<Separator orientation="vertical" />
|
|
84
|
+
),
|
|
85
|
+
)}
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
);
|
|
89
|
+
}
|
|
@@ -2,12 +2,90 @@ import { Button } from '../ui';
|
|
|
2
2
|
import { ConfigOptionsProps, NUMBER_FIELDS, colorOptions } from './data';
|
|
3
3
|
|
|
4
4
|
const css = {
|
|
5
|
-
container:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
container: {
|
|
6
|
+
position: 'fixed',
|
|
7
|
+
bottom: 52,
|
|
8
|
+
right: 8,
|
|
9
|
+
zIndex: 1000,
|
|
10
|
+
pointerEvents: 'auto',
|
|
11
|
+
fontSize: '0.875rem',
|
|
12
|
+
backgroundColor: 'rgba(255,255,255,0.94)',
|
|
13
|
+
backdropFilter: 'blur(4px)',
|
|
14
|
+
boxShadow: '0 4px 6px rgba(15,23,42,0.12)',
|
|
15
|
+
borderWidth: 1,
|
|
16
|
+
borderStyle: 'solid',
|
|
17
|
+
borderColor: 'rgba(148,163,184,0.5)',
|
|
18
|
+
paddingInline: 12,
|
|
19
|
+
paddingBlock: 8,
|
|
20
|
+
width: 'auto',
|
|
21
|
+
display: 'flex',
|
|
22
|
+
flexDirection: 'column',
|
|
23
|
+
gap: 8,
|
|
24
|
+
},
|
|
25
|
+
fieldRow: {
|
|
26
|
+
width: '100%',
|
|
27
|
+
borderBottomWidth: 1,
|
|
28
|
+
borderBottomStyle: 'solid',
|
|
29
|
+
borderBottomColor: 'rgba(148,163,184,0.4)',
|
|
30
|
+
paddingBottom: 12,
|
|
31
|
+
display: 'flex',
|
|
32
|
+
flexDirection: 'column',
|
|
33
|
+
gap: 4,
|
|
34
|
+
},
|
|
35
|
+
wrapper: {
|
|
36
|
+
display: 'flex',
|
|
37
|
+
alignItems: 'flex-end',
|
|
38
|
+
gap: 8,
|
|
39
|
+
borderRadius: 6,
|
|
40
|
+
},
|
|
41
|
+
inputWrapper: {
|
|
42
|
+
width: 104,
|
|
43
|
+
},
|
|
44
|
+
label: {
|
|
45
|
+
display: 'block',
|
|
46
|
+
fontSize: '0.75rem',
|
|
47
|
+
fontWeight: 500,
|
|
48
|
+
marginBottom: 4,
|
|
49
|
+
},
|
|
50
|
+
numberInput: {
|
|
51
|
+
width: '100%',
|
|
52
|
+
height: 32,
|
|
53
|
+
borderRadius: 6,
|
|
54
|
+
borderWidth: 1,
|
|
55
|
+
borderStyle: 'solid',
|
|
56
|
+
borderColor: '#e5e7eb',
|
|
57
|
+
paddingInline: 8,
|
|
58
|
+
fontSize: '0.875rem',
|
|
59
|
+
},
|
|
60
|
+
quickRow: {
|
|
61
|
+
display: 'flex',
|
|
62
|
+
gap: 5,
|
|
63
|
+
marginTop: 4,
|
|
64
|
+
},
|
|
65
|
+
quickButton: {
|
|
66
|
+
fontWeight: 500,
|
|
67
|
+
fontSize: '0.875rem',
|
|
68
|
+
},
|
|
69
|
+
colorSection: {
|
|
70
|
+
marginTop: 8,
|
|
71
|
+
},
|
|
72
|
+
colorLabel: {
|
|
73
|
+
display: 'block',
|
|
74
|
+
fontSize: '0.75rem',
|
|
75
|
+
fontWeight: 500,
|
|
76
|
+
marginBottom: 4,
|
|
77
|
+
},
|
|
78
|
+
colorRow: {
|
|
79
|
+
display: 'flex',
|
|
80
|
+
gap: 8,
|
|
81
|
+
},
|
|
82
|
+
colorDot: {
|
|
83
|
+
display: 'block',
|
|
84
|
+
width: '80%',
|
|
85
|
+
height: '80%',
|
|
86
|
+
borderRadius: 9999,
|
|
87
|
+
},
|
|
88
|
+
} as const;
|
|
11
89
|
|
|
12
90
|
export function ConfigOptions(props: ConfigOptionsProps) {
|
|
13
91
|
const fieldBindings = {
|
|
@@ -17,24 +95,24 @@ export function ConfigOptions(props: ConfigOptionsProps) {
|
|
|
17
95
|
};
|
|
18
96
|
|
|
19
97
|
return (
|
|
20
|
-
<div
|
|
98
|
+
<div style={css.container}>
|
|
21
99
|
{NUMBER_FIELDS.map((field) => {
|
|
22
100
|
const binding = fieldBindings[field.key];
|
|
23
101
|
|
|
24
102
|
return (
|
|
25
|
-
<div
|
|
26
|
-
<div
|
|
27
|
-
<div
|
|
28
|
-
<label
|
|
103
|
+
<div style={css.fieldRow} key={field.key}>
|
|
104
|
+
<div style={css.wrapper}>
|
|
105
|
+
<div style={css.inputWrapper}>
|
|
106
|
+
<label style={css.label}>{field.label}</label>
|
|
29
107
|
<input
|
|
30
|
-
|
|
108
|
+
style={css.numberInput}
|
|
31
109
|
type="number"
|
|
32
110
|
step={field.step}
|
|
33
111
|
value={binding.value}
|
|
34
112
|
onChange={(e) => binding.set(+e.target.value)}
|
|
35
113
|
/>
|
|
36
114
|
</div>
|
|
37
|
-
<div
|
|
115
|
+
<div style={css.quickRow}>
|
|
38
116
|
{field.quick.map((v) => {
|
|
39
117
|
return (
|
|
40
118
|
<Button
|
|
@@ -43,7 +121,7 @@ export function ConfigOptions(props: ConfigOptionsProps) {
|
|
|
43
121
|
data-option
|
|
44
122
|
variant="ghost"
|
|
45
123
|
size="icon-sm"
|
|
46
|
-
|
|
124
|
+
style={css.quickButton}
|
|
47
125
|
onClick={() => binding.set(v)}>
|
|
48
126
|
{v}
|
|
49
127
|
</Button>
|
|
@@ -55,18 +133,17 @@ export function ConfigOptions(props: ConfigOptionsProps) {
|
|
|
55
133
|
);
|
|
56
134
|
})}
|
|
57
135
|
|
|
58
|
-
<div
|
|
59
|
-
<span
|
|
60
|
-
<div
|
|
136
|
+
<div style={css.colorSection}>
|
|
137
|
+
<span style={css.colorLabel}>Cor</span>
|
|
138
|
+
<div style={css.colorRow}>
|
|
61
139
|
{colorOptions.map((c) => (
|
|
62
140
|
<Button
|
|
63
141
|
key={c.value}
|
|
64
142
|
variant="ghost"
|
|
65
143
|
size="icon-sm"
|
|
66
144
|
title={c.name}
|
|
67
|
-
className="rounded-full"
|
|
68
145
|
onClick={() => props.setColor(c.value)}>
|
|
69
|
-
<span
|
|
146
|
+
<span style={{ ...css.colorDot, backgroundColor: c.value }} />
|
|
70
147
|
</Button>
|
|
71
148
|
))}
|
|
72
149
|
</div>
|
package/components/data.ts
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
import { Move } from 'lucide-react';
|
|
2
2
|
import { useRef, type MouseEvent as ReactMouseEvent, type RefObject } from 'react';
|
|
3
3
|
import { Button, Icon } from '../ui';
|
|
4
|
+
|
|
5
|
+
const css = {
|
|
6
|
+
wrapper: {
|
|
7
|
+
position: 'absolute' as const,
|
|
8
|
+
left: '50%',
|
|
9
|
+
top: '44%',
|
|
10
|
+
transform: 'translate(-50%, -50%)',
|
|
11
|
+
pointerEvents: 'auto',
|
|
12
|
+
},
|
|
13
|
+
button: {
|
|
14
|
+
borderRadius: 9999,
|
|
15
|
+
backgroundColor: 'rgba(255,255,255,0.75)',
|
|
16
|
+
backdropFilter: 'blur(2px)',
|
|
17
|
+
},
|
|
18
|
+
} as const;
|
|
4
19
|
|
|
5
20
|
export function MoveLinesButton({ targetRef }: { targetRef: RefObject<HTMLDivElement | null> }) {
|
|
6
21
|
const dragging = useRef(false);
|
|
@@ -34,21 +49,13 @@ export function MoveLinesButton({ targetRef }: { targetRef: RefObject<HTMLDivEle
|
|
|
34
49
|
}
|
|
35
50
|
|
|
36
51
|
return (
|
|
37
|
-
<div
|
|
38
|
-
style={{
|
|
39
|
-
position: 'absolute',
|
|
40
|
-
left: '50%',
|
|
41
|
-
top: '44%',
|
|
42
|
-
transform: 'translate(-50%, -50%)',
|
|
43
|
-
pointerEvents: 'auto',
|
|
44
|
-
}}
|
|
45
|
-
>
|
|
52
|
+
<div style={css.wrapper}>
|
|
46
53
|
<Button
|
|
47
54
|
size="icon-sm"
|
|
48
55
|
data-black
|
|
49
56
|
variant="ghost"
|
|
50
57
|
onMouseDown={onMouseDown}
|
|
51
|
-
|
|
58
|
+
style={css.button}>
|
|
52
59
|
<Icon Icon={Move} size="lg" strokeWidth="thin" />
|
|
53
60
|
</Button>
|
|
54
61
|
</div>
|
|
@@ -1,6 +1,40 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ChevronDown, ChevronUp, X } from 'lucide-react';
|
|
3
3
|
import { Button, Icon, Separator } from '../ui/index';
|
|
4
|
+
const css = {
|
|
5
|
+
container: {
|
|
6
|
+
position: 'fixed',
|
|
7
|
+
bottom: 8,
|
|
8
|
+
right: 8,
|
|
9
|
+
zIndex: 9999,
|
|
10
|
+
pointerEvents: 'auto',
|
|
11
|
+
height: 40,
|
|
12
|
+
borderWidth: 1,
|
|
13
|
+
borderStyle: 'solid',
|
|
14
|
+
borderColor: 'rgba(148,163,184,0.8)',
|
|
15
|
+
backgroundColor: 'rgba(255,255,255,0.70)',
|
|
16
|
+
boxShadow: '0 1px 3px rgba(15,23,42,0.2)',
|
|
17
|
+
display: 'flex',
|
|
18
|
+
alignItems: 'center',
|
|
19
|
+
paddingLeft: 14,
|
|
20
|
+
paddingRight: 4,
|
|
21
|
+
},
|
|
22
|
+
label: {
|
|
23
|
+
fontWeight: 500,
|
|
24
|
+
fontSize: '0.8125rem',
|
|
25
|
+
letterSpacing: '0.03em',
|
|
26
|
+
paddingRight: 8,
|
|
27
|
+
},
|
|
28
|
+
buttonsRow: {
|
|
29
|
+
height: '100%',
|
|
30
|
+
display: 'flex',
|
|
31
|
+
alignItems: 'center',
|
|
32
|
+
gap: 4,
|
|
33
|
+
},
|
|
34
|
+
closeIcon: {
|
|
35
|
+
color: '#dc2626',
|
|
36
|
+
},
|
|
37
|
+
};
|
|
4
38
|
export function ConfigButton({ onToggleConfig, open, setShow, }) {
|
|
5
39
|
const handleClick = (e, item) => {
|
|
6
40
|
if (item === 1) {
|
|
@@ -11,13 +45,7 @@ export function ConfigButton({ onToggleConfig, open, setShow, }) {
|
|
|
11
45
|
setShow((v) => !v);
|
|
12
46
|
}
|
|
13
47
|
};
|
|
14
|
-
return (_jsxs("div", { style: {
|
|
15
|
-
position: 'fixed',
|
|
16
|
-
bottom: 8,
|
|
17
|
-
right: 8,
|
|
18
|
-
zIndex: 9999,
|
|
19
|
-
pointerEvents: 'auto',
|
|
20
|
-
}, className: "h-10 border bg-white/66 shadow-sm flex items-center pl-[0.9em] pr-1", children: [_jsx("span", { className: "font-medium text-sm-button tracking-wide pr-2", children: "Configurar" }), _jsx("div", { className: "h-full flex items-center gap-1", children: [1, 2, 3].map((item) => item !== 2 ? (_jsx(Button, { variant: 'transparent', size: "icon-sm", "data-black": true, onClick: (e) => {
|
|
48
|
+
return (_jsxs("div", { style: css.container, children: [_jsx("span", { style: css.label, children: "Configurar" }), _jsx("div", { style: css.buttonsRow, children: [1, 2, 3].map((item) => item !== 2 ? (_jsx(Button, { variant: 'transparent', size: "icon-sm", "data-black": true, onClick: (e) => {
|
|
21
49
|
handleClick(e, item);
|
|
22
|
-
}, children: item === 1 ? (_jsx(Icon, { Icon: open ? ChevronDown : ChevronUp, size: 'xl', strokeWidth: "light" })) : (_jsx(Icon, { Icon: X, size: "sm",
|
|
50
|
+
}, children: item === 1 ? (_jsx(Icon, { Icon: open ? ChevronDown : ChevronUp, size: 'xl', strokeWidth: "light" })) : (_jsx(Icon, { Icon: X, size: "sm", strokeWidth: "light", className: undefined })) }, item)) : (_jsx(Separator, { orientation: "vertical" }))) })] }));
|
|
23
51
|
}
|
|
@@ -2,11 +2,89 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Button } from '../ui';
|
|
3
3
|
import { NUMBER_FIELDS, colorOptions } from './data';
|
|
4
4
|
const css = {
|
|
5
|
-
container:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
container: {
|
|
6
|
+
position: 'fixed',
|
|
7
|
+
bottom: 52,
|
|
8
|
+
right: 8,
|
|
9
|
+
zIndex: 1000,
|
|
10
|
+
pointerEvents: 'auto',
|
|
11
|
+
fontSize: '0.875rem',
|
|
12
|
+
backgroundColor: 'rgba(255,255,255,0.94)',
|
|
13
|
+
backdropFilter: 'blur(4px)',
|
|
14
|
+
boxShadow: '0 4px 6px rgba(15,23,42,0.12)',
|
|
15
|
+
borderWidth: 1,
|
|
16
|
+
borderStyle: 'solid',
|
|
17
|
+
borderColor: 'rgba(148,163,184,0.5)',
|
|
18
|
+
paddingInline: 12,
|
|
19
|
+
paddingBlock: 8,
|
|
20
|
+
width: 'auto',
|
|
21
|
+
display: 'flex',
|
|
22
|
+
flexDirection: 'column',
|
|
23
|
+
gap: 8,
|
|
24
|
+
},
|
|
25
|
+
fieldRow: {
|
|
26
|
+
width: '100%',
|
|
27
|
+
borderBottomWidth: 1,
|
|
28
|
+
borderBottomStyle: 'solid',
|
|
29
|
+
borderBottomColor: 'rgba(148,163,184,0.4)',
|
|
30
|
+
paddingBottom: 12,
|
|
31
|
+
display: 'flex',
|
|
32
|
+
flexDirection: 'column',
|
|
33
|
+
gap: 4,
|
|
34
|
+
},
|
|
35
|
+
wrapper: {
|
|
36
|
+
display: 'flex',
|
|
37
|
+
alignItems: 'flex-end',
|
|
38
|
+
gap: 8,
|
|
39
|
+
borderRadius: 6,
|
|
40
|
+
},
|
|
41
|
+
inputWrapper: {
|
|
42
|
+
width: 104,
|
|
43
|
+
},
|
|
44
|
+
label: {
|
|
45
|
+
display: 'block',
|
|
46
|
+
fontSize: '0.75rem',
|
|
47
|
+
fontWeight: 500,
|
|
48
|
+
marginBottom: 4,
|
|
49
|
+
},
|
|
50
|
+
numberInput: {
|
|
51
|
+
width: '100%',
|
|
52
|
+
height: 32,
|
|
53
|
+
borderRadius: 6,
|
|
54
|
+
borderWidth: 1,
|
|
55
|
+
borderStyle: 'solid',
|
|
56
|
+
borderColor: '#e5e7eb',
|
|
57
|
+
paddingInline: 8,
|
|
58
|
+
fontSize: '0.875rem',
|
|
59
|
+
},
|
|
60
|
+
quickRow: {
|
|
61
|
+
display: 'flex',
|
|
62
|
+
gap: 5,
|
|
63
|
+
marginTop: 4,
|
|
64
|
+
},
|
|
65
|
+
quickButton: {
|
|
66
|
+
fontWeight: 500,
|
|
67
|
+
fontSize: '0.875rem',
|
|
68
|
+
},
|
|
69
|
+
colorSection: {
|
|
70
|
+
marginTop: 8,
|
|
71
|
+
},
|
|
72
|
+
colorLabel: {
|
|
73
|
+
display: 'block',
|
|
74
|
+
fontSize: '0.75rem',
|
|
75
|
+
fontWeight: 500,
|
|
76
|
+
marginBottom: 4,
|
|
77
|
+
},
|
|
78
|
+
colorRow: {
|
|
79
|
+
display: 'flex',
|
|
80
|
+
gap: 8,
|
|
81
|
+
},
|
|
82
|
+
colorDot: {
|
|
83
|
+
display: 'block',
|
|
84
|
+
width: '80%',
|
|
85
|
+
height: '80%',
|
|
86
|
+
borderRadius: 9999,
|
|
87
|
+
},
|
|
10
88
|
};
|
|
11
89
|
export function ConfigOptions(props) {
|
|
12
90
|
const fieldBindings = {
|
|
@@ -14,10 +92,10 @@ export function ConfigOptions(props) {
|
|
|
14
92
|
gap: { value: props.gap, set: props.setGap },
|
|
15
93
|
opacity: { value: props.opacity, set: props.setOpacity },
|
|
16
94
|
};
|
|
17
|
-
return (_jsxs("div", {
|
|
95
|
+
return (_jsxs("div", { style: css.container, children: [NUMBER_FIELDS.map((field) => {
|
|
18
96
|
const binding = fieldBindings[field.key];
|
|
19
|
-
return (_jsx("div", {
|
|
20
|
-
return (_jsx(Button, { selected: binding.value === v, "data-option": true, variant: "ghost", size: "icon-sm",
|
|
97
|
+
return (_jsx("div", { style: css.fieldRow, children: _jsxs("div", { style: css.wrapper, children: [_jsxs("div", { style: css.inputWrapper, children: [_jsx("label", { style: css.label, children: field.label }), _jsx("input", { style: css.numberInput, type: "number", step: field.step, value: binding.value, onChange: (e) => binding.set(+e.target.value) })] }), _jsx("div", { style: css.quickRow, children: field.quick.map((v) => {
|
|
98
|
+
return (_jsx(Button, { selected: binding.value === v, "data-option": true, variant: "ghost", size: "icon-sm", style: css.quickButton, onClick: () => binding.set(v), children: v }, v));
|
|
21
99
|
}) })] }) }, field.key));
|
|
22
|
-
}), _jsxs("div", {
|
|
100
|
+
}), _jsxs("div", { style: css.colorSection, children: [_jsx("span", { style: css.colorLabel, children: "Cor" }), _jsx("div", { style: css.colorRow, children: colorOptions.map((c) => (_jsx(Button, { variant: "ghost", size: "icon-sm", title: c.name, onClick: () => props.setColor(c.value), children: _jsx("span", { style: { ...css.colorDot, backgroundColor: c.value } }) }, c.value))) })] })] }));
|
|
23
101
|
}
|
package/dist/components/data.js
CHANGED
|
@@ -2,6 +2,20 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Move } from 'lucide-react';
|
|
3
3
|
import { useRef } from 'react';
|
|
4
4
|
import { Button, Icon } from '../ui';
|
|
5
|
+
const css = {
|
|
6
|
+
wrapper: {
|
|
7
|
+
position: 'absolute',
|
|
8
|
+
left: '50%',
|
|
9
|
+
top: '44%',
|
|
10
|
+
transform: 'translate(-50%, -50%)',
|
|
11
|
+
pointerEvents: 'auto',
|
|
12
|
+
},
|
|
13
|
+
button: {
|
|
14
|
+
borderRadius: 9999,
|
|
15
|
+
backgroundColor: 'rgba(255,255,255,0.75)',
|
|
16
|
+
backdropFilter: 'blur(2px)',
|
|
17
|
+
},
|
|
18
|
+
};
|
|
5
19
|
export function MoveLinesButton({ targetRef }) {
|
|
6
20
|
const dragging = useRef(false);
|
|
7
21
|
const last = useRef({ x: 0, y: 0 });
|
|
@@ -26,11 +40,5 @@ export function MoveLinesButton({ targetRef }) {
|
|
|
26
40
|
document.removeEventListener('mousemove', onMove);
|
|
27
41
|
document.removeEventListener('mouseup', onUp);
|
|
28
42
|
}
|
|
29
|
-
return (_jsx("div", { style: {
|
|
30
|
-
position: 'absolute',
|
|
31
|
-
left: '50%',
|
|
32
|
-
top: '44%',
|
|
33
|
-
transform: 'translate(-50%, -50%)',
|
|
34
|
-
pointerEvents: 'auto',
|
|
35
|
-
}, children: _jsx(Button, { size: "icon-sm", "data-black": true, variant: "ghost", onMouseDown: onMouseDown, className: "rounded-full bg-white/75 backdrop-blur-xs", children: _jsx(Icon, { Icon: Move, size: "lg", strokeWidth: "thin" }) }) }));
|
|
43
|
+
return (_jsx("div", { style: css.wrapper, children: _jsx(Button, { size: "icon-sm", "data-black": true, variant: "ghost", onMouseDown: onMouseDown, style: css.button, children: _jsx(Icon, { Icon: Move, size: "lg", strokeWidth: "thin" }) }) }));
|
|
36
44
|
}
|
package/dist/lines-overlay.js
CHANGED
|
@@ -3,6 +3,29 @@ import { Eye } from "lucide-react";
|
|
|
3
3
|
import { useEffect, useRef, useState } from "react";
|
|
4
4
|
import { ConfigButton, ConfigOptions, MoveLinesButton, } from "./components/index";
|
|
5
5
|
import { Button, Icon } from "./ui";
|
|
6
|
+
const css = {
|
|
7
|
+
overlay: {
|
|
8
|
+
position: 'fixed',
|
|
9
|
+
top: 100,
|
|
10
|
+
left: 0,
|
|
11
|
+
width: '100%',
|
|
12
|
+
pointerEvents: 'none',
|
|
13
|
+
display: 'flex',
|
|
14
|
+
justifyContent: 'center',
|
|
15
|
+
zIndex: 9998,
|
|
16
|
+
},
|
|
17
|
+
grid: {
|
|
18
|
+
width: '100%',
|
|
19
|
+
},
|
|
20
|
+
triggerButton: {
|
|
21
|
+
position: 'fixed',
|
|
22
|
+
bottom: 8,
|
|
23
|
+
right: 8,
|
|
24
|
+
zIndex: 9999,
|
|
25
|
+
fontSize: '0.75rem',
|
|
26
|
+
backgroundColor: 'rgba(255,255,255,0.66)',
|
|
27
|
+
},
|
|
28
|
+
};
|
|
6
29
|
function RowGridCore({ show, setShow }) {
|
|
7
30
|
const containerRef = useRef(null);
|
|
8
31
|
const [lines, setLines] = useState(12);
|
|
@@ -23,35 +46,20 @@ function RowGridCore({ show, setShow }) {
|
|
|
23
46
|
if (!show)
|
|
24
47
|
return null;
|
|
25
48
|
const height = lines * gap;
|
|
26
|
-
return (_jsxs("div", { children: [_jsxs("div", { ref: containerRef, style: {
|
|
27
|
-
|
|
28
|
-
top: 100,
|
|
29
|
-
left: 0,
|
|
30
|
-
width: "100%",
|
|
31
|
-
height,
|
|
32
|
-
pointerEvents: "none",
|
|
33
|
-
display: "flex",
|
|
34
|
-
justifyContent: "center",
|
|
35
|
-
zIndex: 9998,
|
|
36
|
-
}, children: [_jsx("div", { className: "w-full", style: {
|
|
49
|
+
return (_jsxs("div", { children: [_jsxs("div", { ref: containerRef, style: { ...css.overlay, height }, children: [_jsx("div", { style: {
|
|
50
|
+
...css.grid,
|
|
37
51
|
height,
|
|
38
|
-
backgroundImage: `repeating-linear-gradient(
|
|
39
|
-
to bottom,
|
|
40
|
-
${color},
|
|
41
|
-
${color} 1px,
|
|
42
|
-
transparent 1px,
|
|
43
|
-
transparent ${gap}px
|
|
52
|
+
backgroundImage: `repeating-linear-gradient(
|
|
53
|
+
to bottom,
|
|
54
|
+
${color},
|
|
55
|
+
${color} 1px,
|
|
56
|
+
transparent 1px,
|
|
57
|
+
transparent ${gap}px
|
|
44
58
|
)`,
|
|
45
59
|
opacity,
|
|
46
60
|
} }), _jsx(MoveLinesButton, { targetRef: containerRef })] }), _jsx(ConfigButton, { setShow: setShow, onToggleConfig: () => setShowConfig((v) => !v), open: showConfig }), showConfig && (_jsx(ConfigOptions, { lines: lines, gap: gap, opacity: opacity, color: color, setLines: setLines, setGap: setGap, setOpacity: setOpacity, setColor: setColor }))] }));
|
|
47
61
|
}
|
|
48
62
|
export function RowGrid() {
|
|
49
63
|
const [show, setShow] = useState(false);
|
|
50
|
-
return (_jsxs(_Fragment, { children: [_jsxs(Button, { size: "sm", variant: "ghost", style: {
|
|
51
|
-
visibility: show ? "hidden" : "visible",
|
|
52
|
-
position: "fixed",
|
|
53
|
-
bottom: 8,
|
|
54
|
-
right: 8,
|
|
55
|
-
zIndex: 9999,
|
|
56
|
-
}, onClick: () => setShow((v) => !v), className: "text-xs bg-white/66", children: ["Mostrar linhas", _jsx(Icon, { Icon: Eye })] }), _jsx(RowGridCore, { setShow: setShow, show: show })] }));
|
|
64
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Button, { size: "sm", variant: "ghost", style: { ...css.triggerButton, visibility: show ? 'hidden' : 'visible' }, onClick: () => setShow((v) => !v), children: ["Mostrar linhas", _jsx(Icon, { Icon: Eye })] }), _jsx(RowGridCore, { setShow: setShow, show: show })] }));
|
|
57
65
|
}
|