lines-overlay 0.1.26 → 0.1.28
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/dist/index.js +15 -39
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +29 -53
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/config-options.tsx +1 -1
- package/src/components/move-lines-button.tsx +0 -15
- package/src/lines-overlay.tsx +2 -5
package/dist/index.js
CHANGED
|
@@ -272,9 +272,7 @@ var css3 = {
|
|
|
272
272
|
}
|
|
273
273
|
};
|
|
274
274
|
function MoveLinesButton({
|
|
275
|
-
targetRef
|
|
276
|
-
color,
|
|
277
|
-
opacity
|
|
275
|
+
targetRef
|
|
278
276
|
}) {
|
|
279
277
|
const dragging = (0, import_react.useRef)(false);
|
|
280
278
|
const last = (0, import_react.useRef)({ x: 0, y: 0 });
|
|
@@ -298,33 +296,17 @@ function MoveLinesButton({
|
|
|
298
296
|
document.removeEventListener("mousemove", onMove);
|
|
299
297
|
document.removeEventListener("mouseup", onUp);
|
|
300
298
|
}
|
|
301
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
),
|
|
313
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
314
|
-
"div",
|
|
315
|
-
{
|
|
316
|
-
style: {
|
|
317
|
-
width: "100%",
|
|
318
|
-
height: 1.25,
|
|
319
|
-
position: "absolute",
|
|
320
|
-
left: 0,
|
|
321
|
-
bottom: 0,
|
|
322
|
-
backgroundColor: color,
|
|
323
|
-
opacity
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
)
|
|
327
|
-
] });
|
|
299
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { style: css3.wrapper, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
300
|
+
Button,
|
|
301
|
+
{
|
|
302
|
+
size: "icon-sm",
|
|
303
|
+
"data-black": true,
|
|
304
|
+
variant: "ghost",
|
|
305
|
+
onMouseDown,
|
|
306
|
+
style: css3.button,
|
|
307
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { Icon: import_lucide_react.Move, size: "3xl", strokeWidth: "2" })
|
|
308
|
+
}
|
|
309
|
+
) });
|
|
328
310
|
}
|
|
329
311
|
|
|
330
312
|
// src/components/config-button.tsx
|
|
@@ -511,7 +493,7 @@ var css5 = {
|
|
|
511
493
|
borderRadius: 999
|
|
512
494
|
},
|
|
513
495
|
colorSection: {
|
|
514
|
-
|
|
496
|
+
marginBottom: 12
|
|
515
497
|
},
|
|
516
498
|
colorLabel: {
|
|
517
499
|
display: "block",
|
|
@@ -666,18 +648,12 @@ function Core({ show, setShow }) {
|
|
|
666
648
|
transparent ${gap}px
|
|
667
649
|
)`,
|
|
668
650
|
opacity,
|
|
651
|
+
borderBottom: `1.5px solid ${color}`,
|
|
669
652
|
transform: `rotate(${rotate}deg)`
|
|
670
653
|
}
|
|
671
654
|
}
|
|
672
655
|
),
|
|
673
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
674
|
-
MoveLinesButton,
|
|
675
|
-
{
|
|
676
|
-
targetRef: containerRef,
|
|
677
|
-
color,
|
|
678
|
-
opacity
|
|
679
|
-
}
|
|
680
|
-
)
|
|
656
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(MoveLinesButton, { targetRef: containerRef })
|
|
681
657
|
] }),
|
|
682
658
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
683
659
|
ConfigButton,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/lines-overlay.tsx","../src/components/move-lines-button.tsx","../src/ui/button.tsx","../src/ui/lucide-icon.tsx","../src/ui/separator.tsx","../src/components/config-button.tsx","../src/components/config-options.tsx","../src/components/data.ts"],"sourcesContent":["export { LinesOverlay } from \"./lines-overlay\";\n","import { Eye } from \"lucide-react\";\r\nimport { useEffect, useRef, useState } from \"react\";\r\nimport {\r\n ConfigButton,\r\n ConfigOptions,\r\n MoveLinesButton,\r\n} from \"./components/index\";\r\nimport { StateSetter } from \"../types\";\r\nimport { Button, Icon } from \"./ui\";\r\n\r\ntype Props = {\r\n setShow: StateSetter<boolean>;\r\n show: boolean;\r\n};\r\n\r\nconst css = {\r\n overlay: {\r\n position: \"absolute\" as const,\r\n top: 175,\r\n left: 0,\r\n width: \"100%\",\r\n pointerEvents: \"none\" as const,\r\n display: \"flex\",\r\n justifyContent: \"center\",\r\n zIndex: 10,\r\n },\r\n grid: {\r\n width: \"100%\",\r\n },\r\n triggerButton: {\r\n position: \"absolute\" as const,\r\n bottom: 8,\r\n right: 8,\r\n zIndex: 20,\r\n backgroundColor: \"rgba(255,255,255,0.70)\",\r\n },\r\n} as const;\r\n\r\nfunction Core({ show, setShow }: Props) {\r\n const containerRef = useRef<HTMLDivElement>(null);\r\n const [lines, setLines] = useState(12);\r\n const [gap, setGap] = useState(24);\r\n const [opacity, setOpacity] = useState(0.3);\r\n const [color, setColor] = useState(\"#d71212\");\r\n const [showConfig, setShowConfig] = useState(false);\r\n const [rotate, setRotate] = useState(0);\r\n\r\n // Toggle por tecla\r\n useEffect(() => {\r\n const handler = (e: KeyboardEvent) => {\r\n if (e.ctrlKey && e.key === \";\") {\r\n setShow((v) => !v);\r\n }\r\n };\r\n window.addEventListener(\"keydown\", handler);\r\n return () => window.removeEventListener(\"keydown\", handler);\r\n }, []);\r\n\r\n if (!show) return null;\r\n\r\n const height = lines * gap;\r\n\r\n return (\r\n <>\r\n <div ref={containerRef} style={{ ...css.overlay, height }}>\r\n {/* linhas */}\r\n <div\r\n style={{\r\n ...css.grid,\r\n height,\r\n backgroundImage: `repeating-linear-gradient(\r\n to bottom,\r\n ${color},\r\n ${color} 1.25px,\r\n transparent 1px,\r\n transparent ${gap}px\r\n )`,\r\n opacity,\r\n transform: `rotate(${rotate}deg)`,\r\n }}\r\n />\r\n {/* Move */}\r\n <MoveLinesButton\r\n targetRef={containerRef}\r\n color={color}\r\n opacity={opacity}\r\n />\r\n </div>\r\n {/* Config */}\r\n <ConfigButton\r\n setShow={setShow}\r\n onToggleConfig={() => setShowConfig((v) => !v)}\r\n open={showConfig}\r\n />\r\n {showConfig && (\r\n <ConfigOptions\r\n rotate={rotate}\r\n setRotate={setRotate}\r\n lines={lines}\r\n gap={gap}\r\n opacity={opacity}\r\n color={color}\r\n setLines={setLines}\r\n setGap={setGap}\r\n setOpacity={setOpacity}\r\n setColor={setColor}\r\n />\r\n )}\r\n </>\r\n );\r\n}\r\n\r\nexport function LinesOverlay() {\r\n const [show, setShow] = useState(false);\r\n\r\n return (\r\n <div\r\n style={{\r\n position: \"fixed\",\r\n zIndex: 9000,\r\n bottom: 0,\r\n left: 0,\r\n width: \"100%\",\r\n height: \"100dvh\",\r\n fontFamily: \"Inter, sans-serif\",\r\n }}\r\n >\r\n <Core setShow={setShow} show={show} />\r\n\r\n <Button\r\n size=\"sm\"\r\n variant=\"ghost\"\r\n style={{\r\n ...css.triggerButton,\r\n visibility: show ? \"hidden\" : \"visible\",\r\n }}\r\n onClick={() => setShow((v) => !v)}\r\n >\r\n <Icon Icon={Eye} size=\"xl\" />\r\n Mostrar linhas - <span style={{ color: \"#787878ff\" }}>Ctrl + ;</span>\r\n </Button>\r\n </div>\r\n );\r\n}\r\n","import { Move } from 'lucide-react';\r\nimport { useRef, type MouseEvent as ReactMouseEvent, type RefObject } from 'react';\r\nimport { Button, Icon } from '../ui';\r\n\r\nconst css = {\r\n wrapper: {\r\n width: \"100%\",\r\n height: \"100%\",\r\n position: \"absolute\" as const,\r\n left: 0,\r\n top: 0,\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n justifyContent: \"center\",\r\n pointerEvents: \"auto\",\r\n },\r\n button: {\r\n backgroundColor: \"rgba(255,255,255,0.75)\",\r\n backdropFilter: \"blur(2px)\",\r\n borderRadius: 9999,\r\n },\r\n} as const;\r\n\r\nexport function MoveLinesButton({\r\n targetRef,\r\n color,\r\n opacity,\r\n}: {\r\n targetRef: RefObject<HTMLDivElement | null>;\r\n color: string;\r\n opacity: number;\r\n}) {\r\n const dragging = useRef(false);\r\n const last = useRef({ x: 0, y: 0 });\r\n\r\n function onMouseDown(e: ReactMouseEvent<HTMLButtonElement>) {\r\n dragging.current = true;\r\n last.current = { x: e.clientX, y: e.clientY };\r\n document.addEventListener(\"mousemove\", onMove);\r\n document.addEventListener(\"mouseup\", onUp);\r\n }\r\n\r\n function onMove(e: MouseEvent) {\r\n if (!dragging.current || !targetRef.current) return;\r\n\r\n const dx = e.clientX - last.current.x;\r\n const dy = e.clientY - last.current.y;\r\n\r\n const el = targetRef.current;\r\n\r\n el.style.left = `${el.offsetLeft + dx}px`;\r\n el.style.top = `${el.offsetTop + dy}px`;\r\n\r\n last.current = { x: e.clientX, y: e.clientY };\r\n }\r\n\r\n function onUp() {\r\n dragging.current = false;\r\n document.removeEventListener(\"mousemove\", onMove);\r\n document.removeEventListener(\"mouseup\", onUp);\r\n }\r\n\r\n return (\r\n <div style={css.wrapper}>\r\n <Button\r\n size=\"icon-sm\"\r\n data-black\r\n variant=\"ghost\"\r\n onMouseDown={onMouseDown}\r\n style={css.button}\r\n >\r\n <Icon Icon={Move} size=\"3xl\" strokeWidth=\"2\" />\r\n </Button>\r\n <div\r\n style={{\r\n width: \"100%\",\r\n height: 1.25,\r\n position: \"absolute\",\r\n left: 0,\r\n bottom: 0,\r\n backgroundColor: color,\r\n opacity,\r\n }}\r\n />\r\n </div>\r\n );\r\n}","import * as React from 'react';\r\n\r\ntype ButtonVariant = 'default' | 'ghost' | 'transparent';\r\ntype ButtonSize = 'default' | 'sm' | 'icon-sm';\r\n\r\nconst styles = {\r\n base: {\r\n width: 'auto',\r\n display: 'inline-flex',\r\n alignItems: 'center',\r\n justifyContent: 'center',\r\n gap: 8,\n borderRadius: 4,\n position: 'relative',\r\n outline: 'none',\r\n userSelect: 'none',\r\n } satisfies React.CSSProperties,\r\n\r\n variants: {\r\n default: {\r\n backgroundColor: '#0ea5e9',\r\n color: '#ffffff',\r\n },\r\n ghost: {\r\n backgroundColor: 'transparent',\r\n color: '#111827',\r\n border: '1px solid #e5e7eb',\r\n },\r\n transparent: {\r\n backgroundColor: 'transparent',\r\n color: '#0ea5e9',\r\n },\r\n } satisfies Record<ButtonVariant, React.CSSProperties>,\r\n\r\n sizes: {\r\n default: {\r\n minHeight: 40,\r\n paddingInline: 12,\r\n paddingBlock: 12 * 0.73438 / 0.93,\r\n },\r\n sm: {\r\n minHeight: 36,\r\n paddingInline: 12,\r\n paddingBlock: 10,\r\n },\r\n 'icon-sm': {\r\n width: 32,\r\n height: 32,\r\n padding: 0,\r\n },\r\n } satisfies Record<ButtonSize, React.CSSProperties>,\r\n\r\n selected: {\r\n border: '2px solid #60a5fa',\r\n color: '#0ea5e9',\r\n backgroundColor: 'rgba(59,130,246,0.08)',\r\n } satisfies React.CSSProperties,\r\n\r\n closeButton: {\r\n color: '#0f172a',\r\n } satisfies React.CSSProperties,\r\n};\r\n\r\n\r\nexport interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\r\n asChild?: boolean;\r\n selected?: boolean;\r\n disabled?: boolean;\r\n closeButton?: boolean;\r\n variant?: ButtonVariant;\r\n size?: ButtonSize;\r\n}\r\n\r\ntype ResolveButtonStyleParams = {\r\n variant: ButtonVariant;\r\n size: ButtonSize;\r\n selected?: boolean;\r\n disabled?: boolean;\r\n closeButton?: boolean;\r\n style?: React.CSSProperties;\r\n};\r\n\r\nexport function resolveButtonStyles({\r\n variant,\r\n size,\r\n selected,\r\n disabled,\r\n closeButton,\r\n style,\r\n}: ResolveButtonStyleParams): React.CSSProperties {\r\n return {\r\n ...styles.base,\r\n ...styles.variants[variant],\r\n ...styles.sizes[size],\r\n ...(disabled && { opacity: 0.6, cursor: 'not-allowed' }),\r\n ...(selected && styles.selected),\r\n ...(closeButton && styles.closeButton),\r\n ...style,\r\n };\r\n}\r\n\r\ntype SlotProps = React.HTMLAttributes<HTMLElement> & {\r\n children?: React.ReactNode;\r\n};\r\n\r\nconst Slot = React.forwardRef<HTMLElement, SlotProps>(\r\n ({ children, className, style, ...slotProps }, ref) => {\r\n if (!children || !React.isValidElement(children)) {\r\n return null;\r\n }\r\n\r\n const child = children as React.ReactElement<any>;\r\n const mergedClassName = [className, child.props.className].filter(Boolean).join(' ');\r\n const mergedStyle = { ...style, ...child.props.style };\r\n\r\n return React.cloneElement(child, {\r\n ...slotProps,\r\n ...child.props,\r\n className: mergedClassName || undefined,\r\n style: mergedStyle,\r\n ref,\r\n });\r\n },\r\n);\r\n\r\n\r\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\r\n (\r\n {\r\n className,\r\n variant = 'default',\r\n size = 'default',\r\n asChild = false,\r\n selected = false,\r\n disabled = false,\r\n closeButton = false,\r\n style,\r\n ...props\r\n },\r\n ref,\r\n ) => {\r\n const Comp = asChild ? Slot : 'button';\r\n\r\n return (\r\n <Comp\r\n ref={ref}\r\n className={className}\r\n disabled={disabled}\r\n style={resolveButtonStyles({\r\n variant,\r\n size,\r\n selected,\r\n disabled,\r\n closeButton,\r\n style,\r\n })}\r\n {...props}\r\n />\r\n );\r\n },\r\n);\r\n\r\n","import type { LucideIcon as LucideIconType, LucideProps } from 'lucide-react';\r\n\r\ntype StrokeWidthValue = keyof typeof weights;\r\nconst weights = {\r\n thin: 2.25,\r\n light: 2.35,\r\n normal: 2.65,\r\n semibold: 2.75,\r\n bold: 2.85,\r\n extrabold: 3,\r\n};\r\n\r\ntype SizeValue = keyof typeof iconSizes;\r\n\r\nconst iconSizes = {\r\n xs: '0.937em',\r\n sm: '0.968em',\r\n base: '1em',\r\n md: '1.033em',\r\n lg: '1.067em',\r\n xl: '1.138em',\r\n '2xl': '1.215em',\r\n '3xl': '1.296em',\r\n h6: '1.067em',\r\n h5: '1.138em',\r\n h4: '1.215em',\r\n h3: '1.296em',\r\n h2: '1.383em',\r\n h1: '1.4757em',\r\n};\r\n\r\nconst css = {\r\n wrapper: {\r\n height: '0.75rem',\r\n display: 'inline-flex',\r\n justifyContent: 'center',\r\n alignItems: 'center',\r\n overflow: 'visible' as const,\r\n },\r\n} as const;\r\n\r\ninterface IconProps extends Omit<LucideProps, 'size' | 'strokeWidth'> {\r\n Icon: LucideIconType;\r\n size?: SizeValue | string;\r\n strokeWidth?: StrokeWidthValue | string;\r\n}\r\n\r\nexport const Icon = ({ Icon, size, className, strokeWidth, fill }: IconProps) => {\r\n return (\r\n <div data-icon style={css.wrapper}>\r\n <Icon\r\n size={iconSizes[size as SizeValue] || size || '1.067em'}\r\n strokeWidth={weights[strokeWidth as StrokeWidthValue] || strokeWidth || 2.6}\r\n className={className}\r\n fill={fill || 'none'}\r\n />\r\n </div>\r\n );\r\n};\r\n","import * as React from 'react';\r\n\r\nconst css = {\r\n base: {\r\n flexShrink: 0,\r\n backgroundColor: '#e5e7eb',\r\n },\r\n horizontal: {\r\n height: 1,\r\n width: '100%',\r\n },\r\n vertical: {\r\n height: '100%',\r\n width: 1,\r\n },\r\n} as const;\r\n\r\ntype SeparatorProps = React.HTMLAttributes<HTMLDivElement> & {\r\n orientation?: 'horizontal' | 'vertical';\r\n decorative?: boolean;\r\n};\r\n\r\nconst Separator = React.forwardRef<HTMLDivElement, SeparatorProps>(\r\n ({ className, orientation = 'horizontal', decorative = true, style, ...props }, ref) => {\r\n const dimensionStyle = orientation === 'horizontal' ? css.horizontal : css.vertical;\r\n\r\n const ariaProps = decorative\r\n ? { role: 'none' as const }\r\n : {\r\n role: 'separator' as const,\r\n 'aria-orientation': orientation,\r\n };\r\n\r\n return (\r\n <div\r\n ref={ref}\r\n style={{ ...css.base, ...dimensionStyle, ...style }}\r\n className={className}\r\n {...ariaProps}\r\n {...props}\r\n />\r\n );\r\n },\r\n);\r\nSeparator.displayName = 'Separator';\r\n\r\nexport { Separator };\r\n","import { ChevronDown, ChevronUp, X } from 'lucide-react';\nimport type { MouseEvent } from 'react';\nimport type { StateSetter } from '../../types';\nimport { Button, Icon, Separator } from '../ui/index';\n\nconst css = {\n container: {\n position: \"fixed\",\n bottom: 8,\n right: 8,\n zIndex: 9999,\n pointerEvents: \"auto\",\n height: 40,\n border: \"1px solid rgba(148,163,184,0.5)\",\n backgroundColor: \"rgba(255,255,255,0.70)\",\n boxShadow: \"0 1px 3px rgba(15,23,42,0.2)\",\n display: \"flex\",\n alignItems: \"center\",\n paddingLeft: 14,\n paddingRight: 4,\n borderRadius: 4,\n },\n label: {\n fontWeight: 600,\n letterSpacing: \"0.03em\",\n paddingRight: 8,\n fontSize: 14,\n userSelect: \"none\",\n },\n buttonsRow: {\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n gap: 4,\n },\n closeIcon: {\n color: \"#dc2626\",\n },\n} as const;\n\nexport function ConfigButton({\n onToggleConfig,\n open,\n setShow,\n}: {\n open: boolean;\n onToggleConfig: () => void;\n setShow: StateSetter<boolean>;\n}) {\n const handleClick = (e: MouseEvent<HTMLButtonElement>, item: number) => {\n if (item === 1) {\n onToggleConfig();\n } else {\n e.stopPropagation();\n setShow((v) => !v);\n }\n };\n\n return (\n <div style={css.container}>\n <span\n style={css.label}\n onClick={(e) => {\n e.stopPropagation();\n onToggleConfig();\n }}\n >\n Configurar\n </span>\n\n <div style={css.buttonsRow}>\n {[1, 2, 3].map((item) =>\n item !== 2 ? (\n <Button\n style={{\n outlineWidth: 1,\n }}\n variant={\"transparent\"}\n size=\"icon-sm\"\n data-black\n key={item}\n onClick={(e) => {\n handleClick(e, item);\n }}\n >\n {item === 1 ? (\n <Icon\n Icon={open ? ChevronDown : ChevronUp}\n size={\"xl\"}\n strokeWidth=\"light\"\n />\n ) : (\n <Icon Icon={X} size=\"sm\" strokeWidth=\"light\" />\n )}\n </Button>\n ) : (\n <Separator orientation=\"vertical\" />\n )\n )}\n </div>\n </div>\n );\n}\n","import { RotateCw } from \"lucide-react\";\r\nimport { Button, Icon } from \"../ui\";\r\nimport { type ConfigOptionsProps, NUMBER_FIELDS, colorOptions } from \"./data\";\r\n\r\nconst css = {\r\n container: {\r\n position: \"fixed\",\r\n bottom: 52,\r\n right: 8,\r\n zIndex: 1000,\r\n pointerEvents: \"auto\",\r\n backgroundColor: \"rgba(255,255,255,0.94)\",\r\n backdropFilter: \"blur(4px)\",\r\n boxShadow: \"0 4px 6px rgba(15,23,42,0.12)\",\r\n border: \"1px solid rgba(148,163,184,0.3)\",\r\n borderRadius: 8,\r\n paddingInline: 12,\r\n paddingBlock: 10,\r\n width: \"auto\",\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n gap: 4,\r\n },\r\n fieldRow: {\r\n width: \"100%\",\r\n marginBottom: 12,\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n gap: 8,\r\n },\r\n wrapper: {\r\n display: \"flex\",\r\n alignItems: \"flex-end\",\r\n gap: 8,\r\n borderRadius: 4,\r\n },\r\n inputWrapper: {\r\n width: 104,\r\n },\r\n label: {\r\n display: \"block\",\r\n fontWeight: 500,\r\n marginBottom: 4,\r\n fontSize: 14,\r\n },\r\n numberInput: {\r\n width: \"100%\",\r\n height: 32,\r\n borderRadius: 4,\r\n border: \"1px solid #e5e7eb\",\r\n paddingInline: 8,\r\n boxSizing: \"border-box\",\r\n },\r\n quickRow: {\r\n display: \"flex\",\r\n gap: 6,\r\n marginTop: 4,\r\n },\r\n quickButton: {\r\n fontWeight: 500,\r\n borderRadius: 999,\r\n },\r\n colorSection: {\r\n marginTop: 0,\r\n },\r\n colorLabel: {\r\n display: \"block\",\r\n fontWeight: 500,\r\n marginBottom: 4,\r\n fontSize: 14,\r\n },\r\n colorRow: {\r\n display: \"flex\",\r\n gap: 8,\r\n },\r\n colorDot: {\r\n display: \"block\",\r\n width: \"80%\",\r\n height: \"80%\",\r\n borderRadius: 999,\r\n },\r\n} as const;\r\n\r\nexport function ConfigOptions(props: ConfigOptionsProps) {\r\n const fieldBindings = {\r\n lines: { value: props.lines, set: props.setLines },\r\n gap: { value: props.gap, set: props.setGap },\r\n opacity: { value: props.opacity, set: props.setOpacity },\r\n };\r\n\r\n return (\r\n <div style={css.container}>\r\n {NUMBER_FIELDS.map((field) => {\r\n const binding = fieldBindings[field.key];\r\n\r\n return (\r\n <div style={css.fieldRow} key={field.key}>\r\n <div style={css.wrapper}>\r\n <div style={css.inputWrapper}>\r\n <label style={css.label}>{field.label}</label>\r\n <input\r\n style={css.numberInput}\r\n type=\"number\"\r\n step={field.step}\r\n value={binding.value}\r\n onChange={(e) => binding.set(+e.target.value)}\r\n />\r\n </div>\r\n <div style={css.quickRow}>\r\n {field.quick.map((v) => {\r\n return (\r\n <Button\r\n selected={binding.value === v}\r\n key={v}\r\n data-option\r\n variant=\"ghost\"\r\n size=\"icon-sm\"\r\n style={css.quickButton}\r\n onClick={() => binding.set(v)}\r\n >\r\n {v}\r\n </Button>\r\n );\r\n })}\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n })}\r\n\r\n <div style={css.colorSection}>\r\n <span style={css.colorLabel}>Cor</span>\r\n <div style={css.colorRow}>\r\n {colorOptions.map((c) => (\r\n <Button\r\n style={{ borderRadius: 999 }}\r\n key={c.value}\r\n variant=\"ghost\"\r\n size=\"icon-sm\"\r\n title={c.name}\r\n onClick={() => props.setColor(c.value)}\r\n >\r\n <span style={{ ...css.colorDot, backgroundColor: c.value }} />\r\n </Button>\r\n ))}\r\n </div>\r\n </div>\r\n\r\n <Button\r\n variant=\"ghost\"\r\n size=\"sm\"\r\n style={{ maxWidth: \"max-content\" }}\r\n onClick={() => {\r\n if (props.rotate === 0) {\r\n props.setRotate(90);\r\n } else {\r\n props.setRotate(0);\r\n }\r\n }}\r\n >\r\n <Icon Icon={RotateCw} /> Rotacionar\r\n </Button>\r\n </div>\r\n );\r\n}\r\n","export type FieldBinding = {\r\n value: number;\r\n set: (v: number) => void;\r\n};\r\n\r\nexport type ConfigOptionsProps = {\r\n lines: number;\r\n gap: number;\r\n opacity: number;\r\n color: string;\r\n setLines: (v: number) => void;\r\n setGap: (v: number) => void;\r\n setOpacity: (v: number) => void;\r\n setColor: (v: string) => void;\r\n rotate: number;\r\n setRotate: (v: number) => void;\r\n};\r\n\r\nexport type NumberFieldConfig = {\r\n key: 'lines' | 'gap' | 'opacity';\r\n label: string;\r\n step?: number;\r\n quick: number[];\r\n};\r\n\r\nexport const NUMBER_FIELDS: NumberFieldConfig[] = [\r\n {\r\n key: 'lines',\r\n label: 'Linhas',\r\n quick: [2, 4, 8, 12],\r\n step: 4,\r\n },\r\n {\r\n key: 'gap',\r\n label: 'Gap',\r\n quick: [16, 24, 32, 40, 44],\r\n step: 4,\r\n },\r\n {\r\n key: 'opacity',\r\n label: 'Opacidade',\r\n quick: [0.2, 0.3, 0.5, 0.7],\r\n step: 0.05,\r\n },\r\n];\r\n\r\nexport const colorOptions = [\r\n { name: 'Azul', value: '#2563eb' },\r\n { name: 'Amarelo', value: '#eab308' },\r\n { name: 'Verde', value: '#16a34a' },\r\n { name: 'Roxo', value: '#7c3aed' },\r\n { name: 'Violeta', value: '#9333ea' },\r\n { name: 'Violeta', value: '#d71212' },\r\n];\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,uBAAoB;AACpB,IAAAC,gBAA4C;;;ACD5C,0BAAqB;AACrB,mBAA2E;;;ACD3E,YAAuB;AAgJjB;AA3IN,IAAM,SAAS;AAAA,EACb,MAAM;AAAA,IACJ,OAAO;AAAA,IACP,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,KAAK;AAAA,IACL,cAAc;AAAA,IACd,UAAU;AAAA,IACV,SAAS;AAAA,IACT,YAAY;AAAA,EACd;AAAA,EAEA,UAAU;AAAA,IACR,SAAS;AAAA,MACP,iBAA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AA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA,KAEJ;AAEJ;AAEO,SAAS,eAAe;AAC7B,QAAM,CAAC,MAAM,OAAO,QAAI,wBAAS,KAAK;AAEtC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAO;AAAA,QACL,UAAU;AAAA,QACV,QAAQ;AAAA,QACR,QAAQ;AAAA,QACR,MAAM;AAAA,QACN,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,YAAY;AAAA,MACd;AAAA,MAEA;AAAA,qDAAC,QAAK,SAAkB,MAAY;AAAA,QAEpC;AAAA,UAAC;AAAA;AAAA,YACC,MAAK;AAAA,YACL,SAAQ;AAAA,YACR,OAAO;AAAA,cACL,GAAGA,KAAI;AAAA,cACP,YAAY,OAAO,WAAW;AAAA,YAChC;AAAA,YACA,SAAS,MAAM,QAAQ,CAAC,MAAM,CAAC,CAAC;AAAA,YAEhC;AAAA,2DAAC,QAAK,MAAM,0BAAK,MAAK,MAAK;AAAA,cAAE;AAAA,cACZ,6CAAC,UAAK,OAAO,EAAE,OAAO,YAAY,GAAG,sBAAQ;AAAA;AAAA;AAAA,QAChE;AAAA;AAAA;AAAA,EACF;AAEJ;","names":["import_lucide_react","import_react","import_jsx_runtime","Icon","React","import_jsx_runtime","css","import_jsx_runtime","css","import_lucide_react","import_jsx_runtime","css","import_lucide_react","import_jsx_runtime","css","import_jsx_runtime","css"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/lines-overlay.tsx","../src/components/move-lines-button.tsx","../src/ui/button.tsx","../src/ui/lucide-icon.tsx","../src/ui/separator.tsx","../src/components/config-button.tsx","../src/components/config-options.tsx","../src/components/data.ts"],"sourcesContent":["export { LinesOverlay } from \"./lines-overlay\";\n","import { Eye } from \"lucide-react\";\r\nimport { useEffect, useRef, useState } from \"react\";\r\nimport {\r\n ConfigButton,\r\n ConfigOptions,\r\n MoveLinesButton,\r\n} from \"./components/index\";\r\nimport { StateSetter } from \"../types\";\r\nimport { Button, Icon } from \"./ui\";\r\n\r\ntype Props = {\r\n setShow: StateSetter<boolean>;\r\n show: boolean;\r\n};\r\n\r\nconst css = {\r\n overlay: {\r\n position: \"absolute\" as const,\r\n top: 175,\r\n left: 0,\r\n width: \"100%\",\r\n pointerEvents: \"none\" as const,\r\n display: \"flex\",\r\n justifyContent: \"center\",\r\n zIndex: 10,\r\n },\r\n grid: {\r\n width: \"100%\",\r\n },\r\n triggerButton: {\r\n position: \"absolute\" as const,\r\n bottom: 8,\r\n right: 8,\r\n zIndex: 20,\r\n backgroundColor: \"rgba(255,255,255,0.70)\",\r\n },\r\n} as const;\r\n\r\nfunction Core({ show, setShow }: Props) {\r\n const containerRef = useRef<HTMLDivElement>(null);\r\n const [lines, setLines] = useState(12);\r\n const [gap, setGap] = useState(24);\r\n const [opacity, setOpacity] = useState(0.3);\r\n const [color, setColor] = useState(\"#d71212\");\r\n const [showConfig, setShowConfig] = useState(false);\r\n const [rotate, setRotate] = useState(0);\r\n\r\n // Toggle por tecla\r\n useEffect(() => {\r\n const handler = (e: KeyboardEvent) => {\r\n if (e.ctrlKey && e.key === \";\") {\r\n setShow((v) => !v);\r\n }\r\n };\r\n window.addEventListener(\"keydown\", handler);\r\n return () => window.removeEventListener(\"keydown\", handler);\r\n }, []);\r\n\r\n if (!show) return null;\r\n\r\n const height = lines * gap;\r\n\r\n return (\r\n <>\r\n <div ref={containerRef} style={{ ...css.overlay, height }}>\r\n {/* linhas */}\r\n <div\r\n style={{\r\n ...css.grid,\r\n height,\r\n backgroundImage: `repeating-linear-gradient(\r\n to bottom,\r\n ${color},\r\n ${color} 1.25px,\r\n transparent 1px,\r\n transparent ${gap}px\r\n )`,\r\n opacity,\r\n borderBottom: `1.5px solid ${color}`,\r\n transform: `rotate(${rotate}deg)`,\r\n }}\r\n />\r\n {/* Move */}\r\n <MoveLinesButton targetRef={containerRef} />\r\n </div>\r\n {/* Config */}\r\n <ConfigButton\r\n setShow={setShow}\r\n onToggleConfig={() => setShowConfig((v) => !v)}\r\n open={showConfig}\r\n />\r\n {showConfig && (\r\n <ConfigOptions\r\n rotate={rotate}\r\n setRotate={setRotate}\r\n lines={lines}\r\n gap={gap}\r\n opacity={opacity}\r\n color={color}\r\n setLines={setLines}\r\n setGap={setGap}\r\n setOpacity={setOpacity}\r\n setColor={setColor}\r\n />\r\n )}\r\n </>\r\n );\r\n}\r\n\r\nexport function LinesOverlay() {\r\n const [show, setShow] = useState(false);\r\n\r\n return (\r\n <div\r\n style={{\r\n position: \"fixed\",\r\n zIndex: 9000,\r\n bottom: 0,\r\n left: 0,\r\n width: \"100%\",\r\n height: \"100dvh\",\r\n fontFamily: \"Inter, sans-serif\",\r\n }}\r\n >\r\n <Core setShow={setShow} show={show} />\r\n\r\n <Button\r\n size=\"sm\"\r\n variant=\"ghost\"\r\n style={{\r\n ...css.triggerButton,\r\n visibility: show ? \"hidden\" : \"visible\",\r\n }}\r\n onClick={() => setShow((v) => !v)}\r\n >\r\n <Icon Icon={Eye} size=\"xl\" />\r\n Mostrar linhas - <span style={{ color: \"#787878ff\" }}>Ctrl + ;</span>\r\n </Button>\r\n </div>\r\n );\r\n}\r\n","import { Move } from 'lucide-react';\r\nimport { useRef, type MouseEvent as ReactMouseEvent, type RefObject } from 'react';\r\nimport { Button, Icon } from '../ui';\r\n\r\nconst css = {\r\n wrapper: {\r\n width: \"100%\",\r\n height: \"100%\",\r\n position: \"absolute\" as const,\r\n left: 0,\r\n top: 0,\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n justifyContent: \"center\",\r\n pointerEvents: \"auto\",\r\n },\r\n button: {\r\n backgroundColor: \"rgba(255,255,255,0.75)\",\r\n backdropFilter: \"blur(2px)\",\r\n borderRadius: 9999,\r\n },\r\n} as const;\r\n\r\nexport function MoveLinesButton({\r\n targetRef,\r\n}: {\r\n targetRef: RefObject<HTMLDivElement | null>;\r\n}) {\r\n const dragging = useRef(false);\r\n const last = useRef({ x: 0, y: 0 });\r\n\r\n function onMouseDown(e: ReactMouseEvent<HTMLButtonElement>) {\r\n dragging.current = true;\r\n last.current = { x: e.clientX, y: e.clientY };\r\n document.addEventListener(\"mousemove\", onMove);\r\n document.addEventListener(\"mouseup\", onUp);\r\n }\r\n\r\n function onMove(e: MouseEvent) {\r\n if (!dragging.current || !targetRef.current) return;\r\n\r\n const dx = e.clientX - last.current.x;\r\n const dy = e.clientY - last.current.y;\r\n\r\n const el = targetRef.current;\r\n\r\n el.style.left = `${el.offsetLeft + dx}px`;\r\n el.style.top = `${el.offsetTop + dy}px`;\r\n\r\n last.current = { x: e.clientX, y: e.clientY };\r\n }\r\n\r\n function onUp() {\r\n dragging.current = false;\r\n document.removeEventListener(\"mousemove\", onMove);\r\n document.removeEventListener(\"mouseup\", onUp);\r\n }\r\n\r\n return (\r\n <div style={css.wrapper}>\r\n <Button\r\n size=\"icon-sm\"\r\n data-black\r\n variant=\"ghost\"\r\n onMouseDown={onMouseDown}\r\n style={css.button}\r\n >\r\n <Icon Icon={Move} size=\"3xl\" strokeWidth=\"2\" />\r\n </Button>\r\n </div>\r\n );\r\n}","import * as React from 'react';\r\n\r\ntype ButtonVariant = 'default' | 'ghost' | 'transparent';\r\ntype ButtonSize = 'default' | 'sm' | 'icon-sm';\r\n\r\nconst styles = {\r\n base: {\r\n width: 'auto',\r\n display: 'inline-flex',\r\n alignItems: 'center',\r\n justifyContent: 'center',\r\n gap: 8,\n borderRadius: 4,\n position: 'relative',\r\n outline: 'none',\r\n userSelect: 'none',\r\n } satisfies React.CSSProperties,\r\n\r\n variants: {\r\n default: {\r\n backgroundColor: '#0ea5e9',\r\n color: '#ffffff',\r\n },\r\n ghost: {\r\n backgroundColor: 'transparent',\r\n color: '#111827',\r\n border: '1px solid #e5e7eb',\r\n },\r\n transparent: {\r\n backgroundColor: 'transparent',\r\n color: '#0ea5e9',\r\n },\r\n } satisfies Record<ButtonVariant, React.CSSProperties>,\r\n\r\n sizes: {\r\n default: {\r\n minHeight: 40,\r\n paddingInline: 12,\r\n paddingBlock: 12 * 0.73438 / 0.93,\r\n },\r\n sm: {\r\n minHeight: 36,\r\n paddingInline: 12,\r\n paddingBlock: 10,\r\n },\r\n 'icon-sm': {\r\n width: 32,\r\n height: 32,\r\n padding: 0,\r\n },\r\n } satisfies Record<ButtonSize, React.CSSProperties>,\r\n\r\n selected: {\r\n border: '2px solid #60a5fa',\r\n color: '#0ea5e9',\r\n backgroundColor: 'rgba(59,130,246,0.08)',\r\n } satisfies React.CSSProperties,\r\n\r\n closeButton: {\r\n color: '#0f172a',\r\n } satisfies React.CSSProperties,\r\n};\r\n\r\n\r\nexport interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\r\n asChild?: boolean;\r\n selected?: boolean;\r\n disabled?: boolean;\r\n closeButton?: boolean;\r\n variant?: ButtonVariant;\r\n size?: ButtonSize;\r\n}\r\n\r\ntype ResolveButtonStyleParams = {\r\n variant: ButtonVariant;\r\n size: ButtonSize;\r\n selected?: boolean;\r\n disabled?: boolean;\r\n closeButton?: boolean;\r\n style?: React.CSSProperties;\r\n};\r\n\r\nexport function resolveButtonStyles({\r\n variant,\r\n size,\r\n selected,\r\n disabled,\r\n closeButton,\r\n style,\r\n}: ResolveButtonStyleParams): React.CSSProperties {\r\n return {\r\n ...styles.base,\r\n ...styles.variants[variant],\r\n ...styles.sizes[size],\r\n ...(disabled && { opacity: 0.6, cursor: 'not-allowed' }),\r\n ...(selected && styles.selected),\r\n ...(closeButton && styles.closeButton),\r\n ...style,\r\n };\r\n}\r\n\r\ntype SlotProps = React.HTMLAttributes<HTMLElement> & {\r\n children?: React.ReactNode;\r\n};\r\n\r\nconst Slot = React.forwardRef<HTMLElement, SlotProps>(\r\n ({ children, className, style, ...slotProps }, ref) => {\r\n if (!children || !React.isValidElement(children)) {\r\n return null;\r\n }\r\n\r\n const child = children as React.ReactElement<any>;\r\n const mergedClassName = [className, child.props.className].filter(Boolean).join(' ');\r\n const mergedStyle = { ...style, ...child.props.style };\r\n\r\n return React.cloneElement(child, {\r\n ...slotProps,\r\n ...child.props,\r\n className: mergedClassName || undefined,\r\n style: mergedStyle,\r\n ref,\r\n });\r\n },\r\n);\r\n\r\n\r\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\r\n (\r\n {\r\n className,\r\n variant = 'default',\r\n size = 'default',\r\n asChild = false,\r\n selected = false,\r\n disabled = false,\r\n closeButton = false,\r\n style,\r\n ...props\r\n },\r\n ref,\r\n ) => {\r\n const Comp = asChild ? Slot : 'button';\r\n\r\n return (\r\n <Comp\r\n ref={ref}\r\n className={className}\r\n disabled={disabled}\r\n style={resolveButtonStyles({\r\n variant,\r\n size,\r\n selected,\r\n disabled,\r\n closeButton,\r\n style,\r\n })}\r\n {...props}\r\n />\r\n );\r\n },\r\n);\r\n\r\n","import type { LucideIcon as LucideIconType, LucideProps } from 'lucide-react';\r\n\r\ntype StrokeWidthValue = keyof typeof weights;\r\nconst weights = {\r\n thin: 2.25,\r\n light: 2.35,\r\n normal: 2.65,\r\n semibold: 2.75,\r\n bold: 2.85,\r\n extrabold: 3,\r\n};\r\n\r\ntype SizeValue = keyof typeof iconSizes;\r\n\r\nconst iconSizes = {\r\n xs: '0.937em',\r\n sm: '0.968em',\r\n base: '1em',\r\n md: '1.033em',\r\n lg: '1.067em',\r\n xl: '1.138em',\r\n '2xl': '1.215em',\r\n '3xl': '1.296em',\r\n h6: '1.067em',\r\n h5: '1.138em',\r\n h4: '1.215em',\r\n h3: '1.296em',\r\n h2: '1.383em',\r\n h1: '1.4757em',\r\n};\r\n\r\nconst css = {\r\n wrapper: {\r\n height: '0.75rem',\r\n display: 'inline-flex',\r\n justifyContent: 'center',\r\n alignItems: 'center',\r\n overflow: 'visible' as const,\r\n },\r\n} as const;\r\n\r\ninterface IconProps extends Omit<LucideProps, 'size' | 'strokeWidth'> {\r\n Icon: LucideIconType;\r\n size?: SizeValue | string;\r\n strokeWidth?: StrokeWidthValue | string;\r\n}\r\n\r\nexport const Icon = ({ Icon, size, className, strokeWidth, fill }: IconProps) => {\r\n return (\r\n <div data-icon style={css.wrapper}>\r\n <Icon\r\n size={iconSizes[size as SizeValue] || size || '1.067em'}\r\n strokeWidth={weights[strokeWidth as StrokeWidthValue] || strokeWidth || 2.6}\r\n className={className}\r\n fill={fill || 'none'}\r\n />\r\n </div>\r\n );\r\n};\r\n","import * as React from 'react';\r\n\r\nconst css = {\r\n base: {\r\n flexShrink: 0,\r\n backgroundColor: '#e5e7eb',\r\n },\r\n horizontal: {\r\n height: 1,\r\n width: '100%',\r\n },\r\n vertical: {\r\n height: '100%',\r\n width: 1,\r\n },\r\n} as const;\r\n\r\ntype SeparatorProps = React.HTMLAttributes<HTMLDivElement> & {\r\n orientation?: 'horizontal' | 'vertical';\r\n decorative?: boolean;\r\n};\r\n\r\nconst Separator = React.forwardRef<HTMLDivElement, SeparatorProps>(\r\n ({ className, orientation = 'horizontal', decorative = true, style, ...props }, ref) => {\r\n const dimensionStyle = orientation === 'horizontal' ? css.horizontal : css.vertical;\r\n\r\n const ariaProps = decorative\r\n ? { role: 'none' as const }\r\n : {\r\n role: 'separator' as const,\r\n 'aria-orientation': orientation,\r\n };\r\n\r\n return (\r\n <div\r\n ref={ref}\r\n style={{ ...css.base, ...dimensionStyle, ...style }}\r\n className={className}\r\n {...ariaProps}\r\n {...props}\r\n />\r\n );\r\n },\r\n);\r\nSeparator.displayName = 'Separator';\r\n\r\nexport { Separator };\r\n","import { ChevronDown, ChevronUp, X } from 'lucide-react';\nimport type { MouseEvent } from 'react';\nimport type { StateSetter } from '../../types';\nimport { Button, Icon, Separator } from '../ui/index';\n\nconst css = {\n container: {\n position: \"fixed\",\n bottom: 8,\n right: 8,\n zIndex: 9999,\n pointerEvents: \"auto\",\n height: 40,\n border: \"1px solid rgba(148,163,184,0.5)\",\n backgroundColor: \"rgba(255,255,255,0.70)\",\n boxShadow: \"0 1px 3px rgba(15,23,42,0.2)\",\n display: \"flex\",\n alignItems: \"center\",\n paddingLeft: 14,\n paddingRight: 4,\n borderRadius: 4,\n },\n label: {\n fontWeight: 600,\n letterSpacing: \"0.03em\",\n paddingRight: 8,\n fontSize: 14,\n userSelect: \"none\",\n },\n buttonsRow: {\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n gap: 4,\n },\n closeIcon: {\n color: \"#dc2626\",\n },\n} as const;\n\nexport function ConfigButton({\n onToggleConfig,\n open,\n setShow,\n}: {\n open: boolean;\n onToggleConfig: () => void;\n setShow: StateSetter<boolean>;\n}) {\n const handleClick = (e: MouseEvent<HTMLButtonElement>, item: number) => {\n if (item === 1) {\n onToggleConfig();\n } else {\n e.stopPropagation();\n setShow((v) => !v);\n }\n };\n\n return (\n <div style={css.container}>\n <span\n style={css.label}\n onClick={(e) => {\n e.stopPropagation();\n onToggleConfig();\n }}\n >\n Configurar\n </span>\n\n <div style={css.buttonsRow}>\n {[1, 2, 3].map((item) =>\n item !== 2 ? (\n <Button\n style={{\n outlineWidth: 1,\n }}\n variant={\"transparent\"}\n size=\"icon-sm\"\n data-black\n key={item}\n onClick={(e) => {\n handleClick(e, item);\n }}\n >\n {item === 1 ? (\n <Icon\n Icon={open ? ChevronDown : ChevronUp}\n size={\"xl\"}\n strokeWidth=\"light\"\n />\n ) : (\n <Icon Icon={X} size=\"sm\" strokeWidth=\"light\" />\n )}\n </Button>\n ) : (\n <Separator orientation=\"vertical\" />\n )\n )}\n </div>\n </div>\n );\n}\n","import { RotateCw } from \"lucide-react\";\r\nimport { Button, Icon } from \"../ui\";\r\nimport { type ConfigOptionsProps, NUMBER_FIELDS, colorOptions } from \"./data\";\r\n\r\nconst css = {\r\n container: {\r\n position: \"fixed\",\r\n bottom: 52,\r\n right: 8,\r\n zIndex: 1000,\r\n pointerEvents: \"auto\",\r\n backgroundColor: \"rgba(255,255,255,0.94)\",\r\n backdropFilter: \"blur(4px)\",\r\n boxShadow: \"0 4px 6px rgba(15,23,42,0.12)\",\r\n border: \"1px solid rgba(148,163,184,0.3)\",\r\n borderRadius: 8,\r\n paddingInline: 12,\r\n paddingBlock: 10,\r\n width: \"auto\",\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n gap: 4,\r\n },\r\n fieldRow: {\r\n width: \"100%\",\r\n marginBottom: 12,\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n gap: 8,\r\n },\r\n wrapper: {\r\n display: \"flex\",\r\n alignItems: \"flex-end\",\r\n gap: 8,\r\n borderRadius: 4,\r\n },\r\n inputWrapper: {\r\n width: 104,\r\n },\r\n label: {\r\n display: \"block\",\r\n fontWeight: 500,\r\n marginBottom: 4,\r\n fontSize: 14,\r\n },\r\n numberInput: {\r\n width: \"100%\",\r\n height: 32,\r\n borderRadius: 4,\r\n border: \"1px solid #e5e7eb\",\r\n paddingInline: 8,\r\n boxSizing: \"border-box\",\r\n },\r\n quickRow: {\r\n display: \"flex\",\r\n gap: 6,\r\n marginTop: 4,\r\n },\r\n quickButton: {\r\n fontWeight: 500,\r\n borderRadius: 999,\r\n },\r\n colorSection: {\r\n marginBottom: 12,\r\n },\r\n colorLabel: {\r\n display: \"block\",\r\n fontWeight: 500,\r\n marginBottom: 4,\r\n fontSize: 14,\r\n },\r\n colorRow: {\r\n display: \"flex\",\r\n gap: 8,\r\n },\r\n colorDot: {\r\n display: \"block\",\r\n width: \"80%\",\r\n height: \"80%\",\r\n borderRadius: 999,\r\n },\r\n} as const;\r\n\r\nexport function ConfigOptions(props: ConfigOptionsProps) {\r\n const fieldBindings = {\r\n lines: { value: props.lines, set: props.setLines },\r\n gap: { value: props.gap, set: props.setGap },\r\n opacity: { value: props.opacity, set: props.setOpacity },\r\n };\r\n\r\n return (\r\n <div style={css.container}>\r\n {NUMBER_FIELDS.map((field) => {\r\n const binding = fieldBindings[field.key];\r\n\r\n return (\r\n <div style={css.fieldRow} key={field.key}>\r\n <div style={css.wrapper}>\r\n <div style={css.inputWrapper}>\r\n <label style={css.label}>{field.label}</label>\r\n <input\r\n style={css.numberInput}\r\n type=\"number\"\r\n step={field.step}\r\n value={binding.value}\r\n onChange={(e) => binding.set(+e.target.value)}\r\n />\r\n </div>\r\n <div style={css.quickRow}>\r\n {field.quick.map((v) => {\r\n return (\r\n <Button\r\n selected={binding.value === v}\r\n key={v}\r\n data-option\r\n variant=\"ghost\"\r\n size=\"icon-sm\"\r\n style={css.quickButton}\r\n onClick={() => binding.set(v)}\r\n >\r\n {v}\r\n </Button>\r\n );\r\n })}\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n })}\r\n\r\n <div style={css.colorSection}>\r\n <span style={css.colorLabel}>Cor</span>\r\n <div style={css.colorRow}>\r\n {colorOptions.map((c) => (\r\n <Button\r\n style={{ borderRadius: 999 }}\r\n key={c.value}\r\n variant=\"ghost\"\r\n size=\"icon-sm\"\r\n title={c.name}\r\n onClick={() => props.setColor(c.value)}\r\n >\r\n <span style={{ ...css.colorDot, backgroundColor: c.value }} />\r\n </Button>\r\n ))}\r\n </div>\r\n </div>\r\n\r\n <Button\r\n variant=\"ghost\"\r\n size=\"sm\"\r\n style={{ maxWidth: \"max-content\" }}\r\n onClick={() => {\r\n if (props.rotate === 0) {\r\n props.setRotate(90);\r\n } else {\r\n props.setRotate(0);\r\n }\r\n }}\r\n >\r\n <Icon Icon={RotateCw} /> Rotacionar\r\n </Button>\r\n </div>\r\n );\r\n}\r\n","export type FieldBinding = {\r\n value: number;\r\n set: (v: number) => void;\r\n};\r\n\r\nexport type ConfigOptionsProps = {\r\n lines: number;\r\n gap: number;\r\n opacity: number;\r\n color: string;\r\n setLines: (v: number) => void;\r\n setGap: (v: number) => void;\r\n setOpacity: (v: number) => void;\r\n setColor: (v: string) => void;\r\n rotate: number;\r\n setRotate: (v: number) => void;\r\n};\r\n\r\nexport type NumberFieldConfig = {\r\n key: 'lines' | 'gap' | 'opacity';\r\n label: string;\r\n step?: number;\r\n quick: number[];\r\n};\r\n\r\nexport const NUMBER_FIELDS: NumberFieldConfig[] = [\r\n {\r\n key: 'lines',\r\n label: 'Linhas',\r\n quick: [2, 4, 8, 12],\r\n step: 4,\r\n },\r\n {\r\n key: 'gap',\r\n label: 'Gap',\r\n quick: [16, 24, 32, 40, 44],\r\n step: 4,\r\n },\r\n {\r\n key: 'opacity',\r\n label: 'Opacidade',\r\n quick: [0.2, 0.3, 0.5, 0.7],\r\n step: 0.05,\r\n },\r\n];\r\n\r\nexport const colorOptions = [\r\n { name: 'Azul', value: '#2563eb' },\r\n { name: 'Amarelo', value: '#eab308' },\r\n { name: 'Verde', value: '#16a34a' },\r\n { name: 'Roxo', value: '#7c3aed' },\r\n { name: 'Violeta', value: '#9333ea' },\r\n { name: 'Violeta', value: '#d71212' },\r\n];\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,uBAAoB;AACpB,IAAAC,gBAA4C;;;ACD5C,0BAAqB;AACrB,mBAA2E;;;ACD3E,YAAuB;AAgJjB;AA3IN,IAAM,SAAS;AAAA,EACb,MAAM;AAAA,IACJ,OAAO;AAAA,IACP,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,KAAK;AAAA,IACL,cAAc;AAAA,IACd,UAAU;AAAA,IACV,SAAS;AAAA,IACT,YAAY;AAAA,EACd;AAAA,EAEA,UAAU;AAAA,IACR,SAAS;AAAA,MACP,iBAAiB;AAAA,MACjB,OAAO;AAAA,IACT;AAAA,IACA,OAAO;AAAA,MACL,iBAAiB;AAAA,MACjB,OAAO;AAAA,MACP,QAAQ;AAAA,IACV;AAAA,IACA,aAAa;AAAA,MACX,iBAAiB;AAAA,MACjB,OAAO;AAAA,IACT;AAAA,EACF;AAAA,EAEA,OAAO;AAAA,IACL,SAAS;AAAA,MACP,WAAW;AAAA,MACX,eAAe;AAAA,MACf,cAAc,KAAK,UAAU;AAAA,IAC/B;AAAA,IACA,IAAI;AAAA,MACF,WAAW;AAAA,MACX,eAAe;AAAA,MACf,cAAc;AAAA,IAChB;AAAA,IACA,WAAW;AAAA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E;AAAA,cACZ,6CAAC,UAAK,OAAO,EAAE,OAAO,YAAY,GAAG,sBAAQ;AAAA;AAAA;AAAA,QAChE;AAAA;AAAA;AAAA,EACF;AAEJ;","names":["import_lucide_react","import_react","import_jsx_runtime","Icon","React","import_jsx_runtime","css","import_jsx_runtime","css","import_lucide_react","import_jsx_runtime","css","import_lucide_react","import_jsx_runtime","css","import_jsx_runtime","css"]}
|
package/dist/index.mjs
CHANGED
|
@@ -216,7 +216,7 @@ var Separator = React2.forwardRef(
|
|
|
216
216
|
Separator.displayName = "Separator";
|
|
217
217
|
|
|
218
218
|
// src/components/move-lines-button.tsx
|
|
219
|
-
import { jsx as jsx4
|
|
219
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
220
220
|
var css3 = {
|
|
221
221
|
wrapper: {
|
|
222
222
|
width: "100%",
|
|
@@ -236,9 +236,7 @@ var css3 = {
|
|
|
236
236
|
}
|
|
237
237
|
};
|
|
238
238
|
function MoveLinesButton({
|
|
239
|
-
targetRef
|
|
240
|
-
color,
|
|
241
|
-
opacity
|
|
239
|
+
targetRef
|
|
242
240
|
}) {
|
|
243
241
|
const dragging = useRef(false);
|
|
244
242
|
const last = useRef({ x: 0, y: 0 });
|
|
@@ -262,38 +260,22 @@ function MoveLinesButton({
|
|
|
262
260
|
document.removeEventListener("mousemove", onMove);
|
|
263
261
|
document.removeEventListener("mouseup", onUp);
|
|
264
262
|
}
|
|
265
|
-
return /* @__PURE__ */
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
),
|
|
277
|
-
/* @__PURE__ */ jsx4(
|
|
278
|
-
"div",
|
|
279
|
-
{
|
|
280
|
-
style: {
|
|
281
|
-
width: "100%",
|
|
282
|
-
height: 1.25,
|
|
283
|
-
position: "absolute",
|
|
284
|
-
left: 0,
|
|
285
|
-
bottom: 0,
|
|
286
|
-
backgroundColor: color,
|
|
287
|
-
opacity
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
)
|
|
291
|
-
] });
|
|
263
|
+
return /* @__PURE__ */ jsx4("div", { style: css3.wrapper, children: /* @__PURE__ */ jsx4(
|
|
264
|
+
Button,
|
|
265
|
+
{
|
|
266
|
+
size: "icon-sm",
|
|
267
|
+
"data-black": true,
|
|
268
|
+
variant: "ghost",
|
|
269
|
+
onMouseDown,
|
|
270
|
+
style: css3.button,
|
|
271
|
+
children: /* @__PURE__ */ jsx4(Icon, { Icon: Move, size: "3xl", strokeWidth: "2" })
|
|
272
|
+
}
|
|
273
|
+
) });
|
|
292
274
|
}
|
|
293
275
|
|
|
294
276
|
// src/components/config-button.tsx
|
|
295
277
|
import { ChevronDown, ChevronUp, X } from "lucide-react";
|
|
296
|
-
import { jsx as jsx5, jsxs
|
|
278
|
+
import { jsx as jsx5, jsxs } from "react/jsx-runtime";
|
|
297
279
|
var css4 = {
|
|
298
280
|
container: {
|
|
299
281
|
position: "fixed",
|
|
@@ -341,7 +323,7 @@ function ConfigButton({
|
|
|
341
323
|
setShow((v) => !v);
|
|
342
324
|
}
|
|
343
325
|
};
|
|
344
|
-
return /* @__PURE__ */
|
|
326
|
+
return /* @__PURE__ */ jsxs("div", { style: css4.container, children: [
|
|
345
327
|
/* @__PURE__ */ jsx5(
|
|
346
328
|
"span",
|
|
347
329
|
{
|
|
@@ -415,7 +397,7 @@ var colorOptions = [
|
|
|
415
397
|
];
|
|
416
398
|
|
|
417
399
|
// src/components/config-options.tsx
|
|
418
|
-
import { jsx as jsx6, jsxs as
|
|
400
|
+
import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
419
401
|
var css5 = {
|
|
420
402
|
container: {
|
|
421
403
|
position: "fixed",
|
|
@@ -475,7 +457,7 @@ var css5 = {
|
|
|
475
457
|
borderRadius: 999
|
|
476
458
|
},
|
|
477
459
|
colorSection: {
|
|
478
|
-
|
|
460
|
+
marginBottom: 12
|
|
479
461
|
},
|
|
480
462
|
colorLabel: {
|
|
481
463
|
display: "block",
|
|
@@ -500,11 +482,11 @@ function ConfigOptions(props) {
|
|
|
500
482
|
gap: { value: props.gap, set: props.setGap },
|
|
501
483
|
opacity: { value: props.opacity, set: props.setOpacity }
|
|
502
484
|
};
|
|
503
|
-
return /* @__PURE__ */
|
|
485
|
+
return /* @__PURE__ */ jsxs2("div", { style: css5.container, children: [
|
|
504
486
|
NUMBER_FIELDS.map((field) => {
|
|
505
487
|
const binding = fieldBindings[field.key];
|
|
506
|
-
return /* @__PURE__ */ jsx6("div", { style: css5.fieldRow, children: /* @__PURE__ */
|
|
507
|
-
/* @__PURE__ */
|
|
488
|
+
return /* @__PURE__ */ jsx6("div", { style: css5.fieldRow, children: /* @__PURE__ */ jsxs2("div", { style: css5.wrapper, children: [
|
|
489
|
+
/* @__PURE__ */ jsxs2("div", { style: css5.inputWrapper, children: [
|
|
508
490
|
/* @__PURE__ */ jsx6("label", { style: css5.label, children: field.label }),
|
|
509
491
|
/* @__PURE__ */ jsx6(
|
|
510
492
|
"input",
|
|
@@ -534,7 +516,7 @@ function ConfigOptions(props) {
|
|
|
534
516
|
}) })
|
|
535
517
|
] }) }, field.key);
|
|
536
518
|
}),
|
|
537
|
-
/* @__PURE__ */
|
|
519
|
+
/* @__PURE__ */ jsxs2("div", { style: css5.colorSection, children: [
|
|
538
520
|
/* @__PURE__ */ jsx6("span", { style: css5.colorLabel, children: "Cor" }),
|
|
539
521
|
/* @__PURE__ */ jsx6("div", { style: css5.colorRow, children: colorOptions.map((c) => /* @__PURE__ */ jsx6(
|
|
540
522
|
Button,
|
|
@@ -549,7 +531,7 @@ function ConfigOptions(props) {
|
|
|
549
531
|
c.value
|
|
550
532
|
)) })
|
|
551
533
|
] }),
|
|
552
|
-
/* @__PURE__ */
|
|
534
|
+
/* @__PURE__ */ jsxs2(
|
|
553
535
|
Button,
|
|
554
536
|
{
|
|
555
537
|
variant: "ghost",
|
|
@@ -572,7 +554,7 @@ function ConfigOptions(props) {
|
|
|
572
554
|
}
|
|
573
555
|
|
|
574
556
|
// src/lines-overlay.tsx
|
|
575
|
-
import { Fragment, jsx as jsx7, jsxs as
|
|
557
|
+
import { Fragment, jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
576
558
|
var css6 = {
|
|
577
559
|
overlay: {
|
|
578
560
|
position: "absolute",
|
|
@@ -614,8 +596,8 @@ function Core({ show, setShow }) {
|
|
|
614
596
|
}, []);
|
|
615
597
|
if (!show) return null;
|
|
616
598
|
const height = lines * gap;
|
|
617
|
-
return /* @__PURE__ */
|
|
618
|
-
/* @__PURE__ */
|
|
599
|
+
return /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
600
|
+
/* @__PURE__ */ jsxs3("div", { ref: containerRef, style: { ...css6.overlay, height }, children: [
|
|
619
601
|
/* @__PURE__ */ jsx7(
|
|
620
602
|
"div",
|
|
621
603
|
{
|
|
@@ -630,18 +612,12 @@ function Core({ show, setShow }) {
|
|
|
630
612
|
transparent ${gap}px
|
|
631
613
|
)`,
|
|
632
614
|
opacity,
|
|
615
|
+
borderBottom: `1.5px solid ${color}`,
|
|
633
616
|
transform: `rotate(${rotate}deg)`
|
|
634
617
|
}
|
|
635
618
|
}
|
|
636
619
|
),
|
|
637
|
-
/* @__PURE__ */ jsx7(
|
|
638
|
-
MoveLinesButton,
|
|
639
|
-
{
|
|
640
|
-
targetRef: containerRef,
|
|
641
|
-
color,
|
|
642
|
-
opacity
|
|
643
|
-
}
|
|
644
|
-
)
|
|
620
|
+
/* @__PURE__ */ jsx7(MoveLinesButton, { targetRef: containerRef })
|
|
645
621
|
] }),
|
|
646
622
|
/* @__PURE__ */ jsx7(
|
|
647
623
|
ConfigButton,
|
|
@@ -670,7 +646,7 @@ function Core({ show, setShow }) {
|
|
|
670
646
|
}
|
|
671
647
|
function LinesOverlay() {
|
|
672
648
|
const [show, setShow] = useState(false);
|
|
673
|
-
return /* @__PURE__ */
|
|
649
|
+
return /* @__PURE__ */ jsxs3(
|
|
674
650
|
"div",
|
|
675
651
|
{
|
|
676
652
|
style: {
|
|
@@ -684,7 +660,7 @@ function LinesOverlay() {
|
|
|
684
660
|
},
|
|
685
661
|
children: [
|
|
686
662
|
/* @__PURE__ */ jsx7(Core, { setShow, show }),
|
|
687
|
-
/* @__PURE__ */
|
|
663
|
+
/* @__PURE__ */ jsxs3(
|
|
688
664
|
Button,
|
|
689
665
|
{
|
|
690
666
|
size: "sm",
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/lines-overlay.tsx","../src/components/move-lines-button.tsx","../src/ui/button.tsx","../src/ui/lucide-icon.tsx","../src/ui/separator.tsx","../src/components/config-button.tsx","../src/components/config-options.tsx","../src/components/data.ts"],"sourcesContent":["import { Eye } from \"lucide-react\";\r\nimport { useEffect, useRef, useState } from \"react\";\r\nimport {\r\n ConfigButton,\r\n ConfigOptions,\r\n MoveLinesButton,\r\n} from \"./components/index\";\r\nimport { StateSetter } from \"../types\";\r\nimport { Button, Icon } from \"./ui\";\r\n\r\ntype Props = {\r\n setShow: StateSetter<boolean>;\r\n show: boolean;\r\n};\r\n\r\nconst css = {\r\n overlay: {\r\n position: \"absolute\" as const,\r\n top: 175,\r\n left: 0,\r\n width: \"100%\",\r\n pointerEvents: \"none\" as const,\r\n display: \"flex\",\r\n justifyContent: \"center\",\r\n zIndex: 10,\r\n },\r\n grid: {\r\n width: \"100%\",\r\n },\r\n triggerButton: {\r\n position: \"absolute\" as const,\r\n bottom: 8,\r\n right: 8,\r\n zIndex: 20,\r\n backgroundColor: \"rgba(255,255,255,0.70)\",\r\n },\r\n} as const;\r\n\r\nfunction Core({ show, setShow }: Props) {\r\n const containerRef = useRef<HTMLDivElement>(null);\r\n const [lines, setLines] = useState(12);\r\n const [gap, setGap] = useState(24);\r\n const [opacity, setOpacity] = useState(0.3);\r\n const [color, setColor] = useState(\"#d71212\");\r\n const [showConfig, setShowConfig] = useState(false);\r\n const [rotate, setRotate] = useState(0);\r\n\r\n // Toggle por tecla\r\n useEffect(() => {\r\n const handler = (e: KeyboardEvent) => {\r\n if (e.ctrlKey && e.key === \";\") {\r\n setShow((v) => !v);\r\n }\r\n };\r\n window.addEventListener(\"keydown\", handler);\r\n return () => window.removeEventListener(\"keydown\", handler);\r\n }, []);\r\n\r\n if (!show) return null;\r\n\r\n const height = lines * gap;\r\n\r\n return (\r\n <>\r\n <div ref={containerRef} style={{ ...css.overlay, height }}>\r\n {/* linhas */}\r\n <div\r\n style={{\r\n ...css.grid,\r\n height,\r\n backgroundImage: `repeating-linear-gradient(\r\n to bottom,\r\n ${color},\r\n ${color} 1.25px,\r\n transparent 1px,\r\n transparent ${gap}px\r\n )`,\r\n opacity,\r\n transform: `rotate(${rotate}deg)`,\r\n }}\r\n />\r\n {/* Move */}\r\n <MoveLinesButton\r\n targetRef={containerRef}\r\n color={color}\r\n opacity={opacity}\r\n />\r\n </div>\r\n {/* Config */}\r\n <ConfigButton\r\n setShow={setShow}\r\n onToggleConfig={() => setShowConfig((v) => !v)}\r\n open={showConfig}\r\n />\r\n {showConfig && (\r\n <ConfigOptions\r\n rotate={rotate}\r\n setRotate={setRotate}\r\n lines={lines}\r\n gap={gap}\r\n opacity={opacity}\r\n color={color}\r\n setLines={setLines}\r\n setGap={setGap}\r\n setOpacity={setOpacity}\r\n setColor={setColor}\r\n />\r\n )}\r\n </>\r\n );\r\n}\r\n\r\nexport function LinesOverlay() {\r\n const [show, setShow] = useState(false);\r\n\r\n return (\r\n <div\r\n style={{\r\n position: \"fixed\",\r\n zIndex: 9000,\r\n bottom: 0,\r\n left: 0,\r\n width: \"100%\",\r\n height: \"100dvh\",\r\n fontFamily: \"Inter, sans-serif\",\r\n }}\r\n >\r\n <Core setShow={setShow} show={show} />\r\n\r\n <Button\r\n size=\"sm\"\r\n variant=\"ghost\"\r\n style={{\r\n ...css.triggerButton,\r\n visibility: show ? \"hidden\" : \"visible\",\r\n }}\r\n onClick={() => setShow((v) => !v)}\r\n >\r\n <Icon Icon={Eye} size=\"xl\" />\r\n Mostrar linhas - <span style={{ color: \"#787878ff\" }}>Ctrl + ;</span>\r\n </Button>\r\n </div>\r\n );\r\n}\r\n","import { Move } from 'lucide-react';\r\nimport { useRef, type MouseEvent as ReactMouseEvent, type RefObject } from 'react';\r\nimport { Button, Icon } from '../ui';\r\n\r\nconst css = {\r\n wrapper: {\r\n width: \"100%\",\r\n height: \"100%\",\r\n position: \"absolute\" as const,\r\n left: 0,\r\n top: 0,\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n justifyContent: \"center\",\r\n pointerEvents: \"auto\",\r\n },\r\n button: {\r\n backgroundColor: \"rgba(255,255,255,0.75)\",\r\n backdropFilter: \"blur(2px)\",\r\n borderRadius: 9999,\r\n },\r\n} as const;\r\n\r\nexport function MoveLinesButton({\r\n targetRef,\r\n color,\r\n opacity,\r\n}: {\r\n targetRef: RefObject<HTMLDivElement | null>;\r\n color: string;\r\n opacity: number;\r\n}) {\r\n const dragging = useRef(false);\r\n const last = useRef({ x: 0, y: 0 });\r\n\r\n function onMouseDown(e: ReactMouseEvent<HTMLButtonElement>) {\r\n dragging.current = true;\r\n last.current = { x: e.clientX, y: e.clientY };\r\n document.addEventListener(\"mousemove\", onMove);\r\n document.addEventListener(\"mouseup\", onUp);\r\n }\r\n\r\n function onMove(e: MouseEvent) {\r\n if (!dragging.current || !targetRef.current) return;\r\n\r\n const dx = e.clientX - last.current.x;\r\n const dy = e.clientY - last.current.y;\r\n\r\n const el = targetRef.current;\r\n\r\n el.style.left = `${el.offsetLeft + dx}px`;\r\n el.style.top = `${el.offsetTop + dy}px`;\r\n\r\n last.current = { x: e.clientX, y: e.clientY };\r\n }\r\n\r\n function onUp() {\r\n dragging.current = false;\r\n document.removeEventListener(\"mousemove\", onMove);\r\n document.removeEventListener(\"mouseup\", onUp);\r\n }\r\n\r\n return (\r\n <div style={css.wrapper}>\r\n <Button\r\n size=\"icon-sm\"\r\n data-black\r\n variant=\"ghost\"\r\n onMouseDown={onMouseDown}\r\n style={css.button}\r\n >\r\n <Icon Icon={Move} size=\"3xl\" strokeWidth=\"2\" />\r\n </Button>\r\n <div\r\n style={{\r\n width: \"100%\",\r\n height: 1.25,\r\n position: \"absolute\",\r\n left: 0,\r\n bottom: 0,\r\n backgroundColor: color,\r\n opacity,\r\n }}\r\n />\r\n </div>\r\n );\r\n}","import * as React from 'react';\r\n\r\ntype ButtonVariant = 'default' | 'ghost' | 'transparent';\r\ntype ButtonSize = 'default' | 'sm' | 'icon-sm';\r\n\r\nconst styles = {\r\n base: {\r\n width: 'auto',\r\n display: 'inline-flex',\r\n alignItems: 'center',\r\n justifyContent: 'center',\r\n gap: 8,\n borderRadius: 4,\n position: 'relative',\r\n outline: 'none',\r\n userSelect: 'none',\r\n } satisfies React.CSSProperties,\r\n\r\n variants: {\r\n default: {\r\n backgroundColor: '#0ea5e9',\r\n color: '#ffffff',\r\n },\r\n ghost: {\r\n backgroundColor: 'transparent',\r\n color: '#111827',\r\n border: '1px solid #e5e7eb',\r\n },\r\n transparent: {\r\n backgroundColor: 'transparent',\r\n color: '#0ea5e9',\r\n },\r\n } satisfies Record<ButtonVariant, React.CSSProperties>,\r\n\r\n sizes: {\r\n default: {\r\n minHeight: 40,\r\n paddingInline: 12,\r\n paddingBlock: 12 * 0.73438 / 0.93,\r\n },\r\n sm: {\r\n minHeight: 36,\r\n paddingInline: 12,\r\n paddingBlock: 10,\r\n },\r\n 'icon-sm': {\r\n width: 32,\r\n height: 32,\r\n padding: 0,\r\n },\r\n } satisfies Record<ButtonSize, React.CSSProperties>,\r\n\r\n selected: {\r\n border: '2px solid #60a5fa',\r\n color: '#0ea5e9',\r\n backgroundColor: 'rgba(59,130,246,0.08)',\r\n } satisfies React.CSSProperties,\r\n\r\n closeButton: {\r\n color: '#0f172a',\r\n } satisfies React.CSSProperties,\r\n};\r\n\r\n\r\nexport interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\r\n asChild?: boolean;\r\n selected?: boolean;\r\n disabled?: boolean;\r\n closeButton?: boolean;\r\n variant?: ButtonVariant;\r\n size?: ButtonSize;\r\n}\r\n\r\ntype ResolveButtonStyleParams = {\r\n variant: ButtonVariant;\r\n size: ButtonSize;\r\n selected?: boolean;\r\n disabled?: boolean;\r\n closeButton?: boolean;\r\n style?: React.CSSProperties;\r\n};\r\n\r\nexport function resolveButtonStyles({\r\n variant,\r\n size,\r\n selected,\r\n disabled,\r\n closeButton,\r\n style,\r\n}: ResolveButtonStyleParams): React.CSSProperties {\r\n return {\r\n ...styles.base,\r\n ...styles.variants[variant],\r\n ...styles.sizes[size],\r\n ...(disabled && { opacity: 0.6, cursor: 'not-allowed' }),\r\n ...(selected && styles.selected),\r\n ...(closeButton && styles.closeButton),\r\n ...style,\r\n };\r\n}\r\n\r\ntype SlotProps = React.HTMLAttributes<HTMLElement> & {\r\n children?: React.ReactNode;\r\n};\r\n\r\nconst Slot = React.forwardRef<HTMLElement, SlotProps>(\r\n ({ children, className, style, ...slotProps }, ref) => {\r\n if (!children || !React.isValidElement(children)) {\r\n return null;\r\n }\r\n\r\n const child = children as React.ReactElement<any>;\r\n const mergedClassName = [className, child.props.className].filter(Boolean).join(' ');\r\n const mergedStyle = { ...style, ...child.props.style };\r\n\r\n return React.cloneElement(child, {\r\n ...slotProps,\r\n ...child.props,\r\n className: mergedClassName || undefined,\r\n style: mergedStyle,\r\n ref,\r\n });\r\n },\r\n);\r\n\r\n\r\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\r\n (\r\n {\r\n className,\r\n variant = 'default',\r\n size = 'default',\r\n asChild = false,\r\n selected = false,\r\n disabled = false,\r\n closeButton = false,\r\n style,\r\n ...props\r\n },\r\n ref,\r\n ) => {\r\n const Comp = asChild ? Slot : 'button';\r\n\r\n return (\r\n <Comp\r\n ref={ref}\r\n className={className}\r\n disabled={disabled}\r\n style={resolveButtonStyles({\r\n variant,\r\n size,\r\n selected,\r\n disabled,\r\n closeButton,\r\n style,\r\n })}\r\n {...props}\r\n />\r\n );\r\n },\r\n);\r\n\r\n","import type { LucideIcon as LucideIconType, LucideProps } from 'lucide-react';\r\n\r\ntype StrokeWidthValue = keyof typeof weights;\r\nconst weights = {\r\n thin: 2.25,\r\n light: 2.35,\r\n normal: 2.65,\r\n semibold: 2.75,\r\n bold: 2.85,\r\n extrabold: 3,\r\n};\r\n\r\ntype SizeValue = keyof typeof iconSizes;\r\n\r\nconst iconSizes = {\r\n xs: '0.937em',\r\n sm: '0.968em',\r\n base: '1em',\r\n md: '1.033em',\r\n lg: '1.067em',\r\n xl: '1.138em',\r\n '2xl': '1.215em',\r\n '3xl': '1.296em',\r\n h6: '1.067em',\r\n h5: '1.138em',\r\n h4: '1.215em',\r\n h3: '1.296em',\r\n h2: '1.383em',\r\n h1: '1.4757em',\r\n};\r\n\r\nconst css = {\r\n wrapper: {\r\n height: '0.75rem',\r\n display: 'inline-flex',\r\n justifyContent: 'center',\r\n alignItems: 'center',\r\n overflow: 'visible' as const,\r\n },\r\n} as const;\r\n\r\ninterface IconProps extends Omit<LucideProps, 'size' | 'strokeWidth'> {\r\n Icon: LucideIconType;\r\n size?: SizeValue | string;\r\n strokeWidth?: StrokeWidthValue | string;\r\n}\r\n\r\nexport const Icon = ({ Icon, size, className, strokeWidth, fill }: IconProps) => {\r\n return (\r\n <div data-icon style={css.wrapper}>\r\n <Icon\r\n size={iconSizes[size as SizeValue] || size || '1.067em'}\r\n strokeWidth={weights[strokeWidth as StrokeWidthValue] || strokeWidth || 2.6}\r\n className={className}\r\n fill={fill || 'none'}\r\n />\r\n </div>\r\n );\r\n};\r\n","import * as React from 'react';\r\n\r\nconst css = {\r\n base: {\r\n flexShrink: 0,\r\n backgroundColor: '#e5e7eb',\r\n },\r\n horizontal: {\r\n height: 1,\r\n width: '100%',\r\n },\r\n vertical: {\r\n height: '100%',\r\n width: 1,\r\n },\r\n} as const;\r\n\r\ntype SeparatorProps = React.HTMLAttributes<HTMLDivElement> & {\r\n orientation?: 'horizontal' | 'vertical';\r\n decorative?: boolean;\r\n};\r\n\r\nconst Separator = React.forwardRef<HTMLDivElement, SeparatorProps>(\r\n ({ className, orientation = 'horizontal', decorative = true, style, ...props }, ref) => {\r\n const dimensionStyle = orientation === 'horizontal' ? css.horizontal : css.vertical;\r\n\r\n const ariaProps = decorative\r\n ? { role: 'none' as const }\r\n : {\r\n role: 'separator' as const,\r\n 'aria-orientation': orientation,\r\n };\r\n\r\n return (\r\n <div\r\n ref={ref}\r\n style={{ ...css.base, ...dimensionStyle, ...style }}\r\n className={className}\r\n {...ariaProps}\r\n {...props}\r\n />\r\n );\r\n },\r\n);\r\nSeparator.displayName = 'Separator';\r\n\r\nexport { Separator };\r\n","import { ChevronDown, ChevronUp, X } from 'lucide-react';\nimport type { MouseEvent } from 'react';\nimport type { StateSetter } from '../../types';\nimport { Button, Icon, Separator } from '../ui/index';\n\nconst css = {\n container: {\n position: \"fixed\",\n bottom: 8,\n right: 8,\n zIndex: 9999,\n pointerEvents: \"auto\",\n height: 40,\n border: \"1px solid rgba(148,163,184,0.5)\",\n backgroundColor: \"rgba(255,255,255,0.70)\",\n boxShadow: \"0 1px 3px rgba(15,23,42,0.2)\",\n display: \"flex\",\n alignItems: \"center\",\n paddingLeft: 14,\n paddingRight: 4,\n borderRadius: 4,\n },\n label: {\n fontWeight: 600,\n letterSpacing: \"0.03em\",\n paddingRight: 8,\n fontSize: 14,\n userSelect: \"none\",\n },\n buttonsRow: {\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n gap: 4,\n },\n closeIcon: {\n color: \"#dc2626\",\n },\n} as const;\n\nexport function ConfigButton({\n onToggleConfig,\n open,\n setShow,\n}: {\n open: boolean;\n onToggleConfig: () => void;\n setShow: StateSetter<boolean>;\n}) {\n const handleClick = (e: MouseEvent<HTMLButtonElement>, item: number) => {\n if (item === 1) {\n onToggleConfig();\n } else {\n e.stopPropagation();\n setShow((v) => !v);\n }\n };\n\n return (\n <div style={css.container}>\n <span\n style={css.label}\n onClick={(e) => {\n e.stopPropagation();\n onToggleConfig();\n }}\n >\n Configurar\n </span>\n\n <div style={css.buttonsRow}>\n {[1, 2, 3].map((item) =>\n item !== 2 ? (\n <Button\n style={{\n outlineWidth: 1,\n }}\n variant={\"transparent\"}\n size=\"icon-sm\"\n data-black\n key={item}\n onClick={(e) => {\n handleClick(e, item);\n }}\n >\n {item === 1 ? (\n <Icon\n Icon={open ? ChevronDown : ChevronUp}\n size={\"xl\"}\n strokeWidth=\"light\"\n />\n ) : (\n <Icon Icon={X} size=\"sm\" strokeWidth=\"light\" />\n )}\n </Button>\n ) : (\n <Separator orientation=\"vertical\" />\n )\n )}\n </div>\n </div>\n );\n}\n","import { RotateCw } from \"lucide-react\";\r\nimport { Button, Icon } from \"../ui\";\r\nimport { type ConfigOptionsProps, NUMBER_FIELDS, colorOptions } from \"./data\";\r\n\r\nconst css = {\r\n container: {\r\n position: \"fixed\",\r\n bottom: 52,\r\n right: 8,\r\n zIndex: 1000,\r\n pointerEvents: \"auto\",\r\n backgroundColor: \"rgba(255,255,255,0.94)\",\r\n backdropFilter: \"blur(4px)\",\r\n boxShadow: \"0 4px 6px rgba(15,23,42,0.12)\",\r\n border: \"1px solid rgba(148,163,184,0.3)\",\r\n borderRadius: 8,\r\n paddingInline: 12,\r\n paddingBlock: 10,\r\n width: \"auto\",\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n gap: 4,\r\n },\r\n fieldRow: {\r\n width: \"100%\",\r\n marginBottom: 12,\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n gap: 8,\r\n },\r\n wrapper: {\r\n display: \"flex\",\r\n alignItems: \"flex-end\",\r\n gap: 8,\r\n borderRadius: 4,\r\n },\r\n inputWrapper: {\r\n width: 104,\r\n },\r\n label: {\r\n display: \"block\",\r\n fontWeight: 500,\r\n marginBottom: 4,\r\n fontSize: 14,\r\n },\r\n numberInput: {\r\n width: \"100%\",\r\n height: 32,\r\n borderRadius: 4,\r\n border: \"1px solid #e5e7eb\",\r\n paddingInline: 8,\r\n boxSizing: \"border-box\",\r\n },\r\n quickRow: {\r\n display: \"flex\",\r\n gap: 6,\r\n marginTop: 4,\r\n },\r\n quickButton: {\r\n fontWeight: 500,\r\n borderRadius: 999,\r\n },\r\n colorSection: {\r\n marginTop: 0,\r\n },\r\n colorLabel: {\r\n display: \"block\",\r\n fontWeight: 500,\r\n marginBottom: 4,\r\n fontSize: 14,\r\n },\r\n colorRow: {\r\n display: \"flex\",\r\n gap: 8,\r\n },\r\n colorDot: {\r\n display: \"block\",\r\n width: \"80%\",\r\n height: \"80%\",\r\n borderRadius: 999,\r\n },\r\n} as const;\r\n\r\nexport function ConfigOptions(props: ConfigOptionsProps) {\r\n const fieldBindings = {\r\n lines: { value: props.lines, set: props.setLines },\r\n gap: { value: props.gap, set: props.setGap },\r\n opacity: { value: props.opacity, set: props.setOpacity },\r\n };\r\n\r\n return (\r\n <div style={css.container}>\r\n {NUMBER_FIELDS.map((field) => {\r\n const binding = fieldBindings[field.key];\r\n\r\n return (\r\n <div style={css.fieldRow} key={field.key}>\r\n <div style={css.wrapper}>\r\n <div style={css.inputWrapper}>\r\n <label style={css.label}>{field.label}</label>\r\n <input\r\n style={css.numberInput}\r\n type=\"number\"\r\n step={field.step}\r\n value={binding.value}\r\n onChange={(e) => binding.set(+e.target.value)}\r\n />\r\n </div>\r\n <div style={css.quickRow}>\r\n {field.quick.map((v) => {\r\n return (\r\n <Button\r\n selected={binding.value === v}\r\n key={v}\r\n data-option\r\n variant=\"ghost\"\r\n size=\"icon-sm\"\r\n style={css.quickButton}\r\n onClick={() => binding.set(v)}\r\n >\r\n {v}\r\n </Button>\r\n );\r\n })}\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n })}\r\n\r\n <div style={css.colorSection}>\r\n <span style={css.colorLabel}>Cor</span>\r\n <div style={css.colorRow}>\r\n {colorOptions.map((c) => (\r\n <Button\r\n style={{ borderRadius: 999 }}\r\n key={c.value}\r\n variant=\"ghost\"\r\n size=\"icon-sm\"\r\n title={c.name}\r\n onClick={() => props.setColor(c.value)}\r\n >\r\n <span style={{ ...css.colorDot, backgroundColor: c.value }} />\r\n </Button>\r\n ))}\r\n </div>\r\n </div>\r\n\r\n <Button\r\n variant=\"ghost\"\r\n size=\"sm\"\r\n style={{ maxWidth: \"max-content\" }}\r\n onClick={() => {\r\n if (props.rotate === 0) {\r\n props.setRotate(90);\r\n } else {\r\n props.setRotate(0);\r\n }\r\n }}\r\n >\r\n <Icon Icon={RotateCw} /> Rotacionar\r\n </Button>\r\n </div>\r\n );\r\n}\r\n","export type FieldBinding = {\r\n value: number;\r\n set: (v: number) => void;\r\n};\r\n\r\nexport type ConfigOptionsProps = {\r\n lines: number;\r\n gap: number;\r\n opacity: number;\r\n color: string;\r\n setLines: (v: number) => void;\r\n setGap: (v: number) => void;\r\n setOpacity: (v: number) => void;\r\n setColor: (v: string) => void;\r\n rotate: number;\r\n setRotate: (v: number) => void;\r\n};\r\n\r\nexport type NumberFieldConfig = {\r\n key: 'lines' | 'gap' | 'opacity';\r\n label: string;\r\n step?: number;\r\n quick: number[];\r\n};\r\n\r\nexport const NUMBER_FIELDS: NumberFieldConfig[] = [\r\n {\r\n key: 'lines',\r\n label: 'Linhas',\r\n quick: [2, 4, 8, 12],\r\n step: 4,\r\n },\r\n {\r\n key: 'gap',\r\n label: 'Gap',\r\n quick: [16, 24, 32, 40, 44],\r\n step: 4,\r\n },\r\n {\r\n key: 'opacity',\r\n label: 'Opacidade',\r\n quick: [0.2, 0.3, 0.5, 0.7],\r\n step: 0.05,\r\n },\r\n];\r\n\r\nexport const colorOptions = [\r\n { name: 'Azul', value: '#2563eb' },\r\n { name: 'Amarelo', value: '#eab308' },\r\n { name: 'Verde', value: '#16a34a' },\r\n { name: 'Roxo', value: '#7c3aed' },\r\n { name: 'Violeta', value: '#9333ea' },\r\n { name: 'Violeta', value: '#d71212' },\r\n];\r\n"],"mappings":";AAAA,SAA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AA,YACA,SAAS,MAAM,QAAQ,CAAC,MAAM,CAAC,CAAC;AAAA,YAEhC;AAAA,8BAAAF,KAAC,QAAK,MAAM,KAAK,MAAK,MAAK;AAAA,cAAE;AAAA,cACZ,gBAAAA,KAAC,UAAK,OAAO,EAAE,OAAO,YAAY,GAAG,sBAAQ;AAAA;AAAA;AAAA,QAChE;AAAA;AAAA;AAAA,EACF;AAEJ;","names":["useRef","jsx","Icon","React","jsx","css","jsx","css","jsx","jsxs","css","jsx","jsxs","css","jsx","jsxs","css","useRef"]}
|
|
1
|
+
{"version":3,"sources":["../src/lines-overlay.tsx","../src/components/move-lines-button.tsx","../src/ui/button.tsx","../src/ui/lucide-icon.tsx","../src/ui/separator.tsx","../src/components/config-button.tsx","../src/components/config-options.tsx","../src/components/data.ts"],"sourcesContent":["import { Eye } from \"lucide-react\";\r\nimport { useEffect, useRef, useState } from \"react\";\r\nimport {\r\n ConfigButton,\r\n ConfigOptions,\r\n MoveLinesButton,\r\n} from \"./components/index\";\r\nimport { StateSetter } from \"../types\";\r\nimport { Button, Icon } from \"./ui\";\r\n\r\ntype Props = {\r\n setShow: StateSetter<boolean>;\r\n show: boolean;\r\n};\r\n\r\nconst css = {\r\n overlay: {\r\n position: \"absolute\" as const,\r\n top: 175,\r\n left: 0,\r\n width: \"100%\",\r\n pointerEvents: \"none\" as const,\r\n display: \"flex\",\r\n justifyContent: \"center\",\r\n zIndex: 10,\r\n },\r\n grid: {\r\n width: \"100%\",\r\n },\r\n triggerButton: {\r\n position: \"absolute\" as const,\r\n bottom: 8,\r\n right: 8,\r\n zIndex: 20,\r\n backgroundColor: \"rgba(255,255,255,0.70)\",\r\n },\r\n} as const;\r\n\r\nfunction Core({ show, setShow }: Props) {\r\n const containerRef = useRef<HTMLDivElement>(null);\r\n const [lines, setLines] = useState(12);\r\n const [gap, setGap] = useState(24);\r\n const [opacity, setOpacity] = useState(0.3);\r\n const [color, setColor] = useState(\"#d71212\");\r\n const [showConfig, setShowConfig] = useState(false);\r\n const [rotate, setRotate] = useState(0);\r\n\r\n // Toggle por tecla\r\n useEffect(() => {\r\n const handler = (e: KeyboardEvent) => {\r\n if (e.ctrlKey && e.key === \";\") {\r\n setShow((v) => !v);\r\n }\r\n };\r\n window.addEventListener(\"keydown\", handler);\r\n return () => window.removeEventListener(\"keydown\", handler);\r\n }, []);\r\n\r\n if (!show) return null;\r\n\r\n const height = lines * gap;\r\n\r\n return (\r\n <>\r\n <div ref={containerRef} style={{ ...css.overlay, height }}>\r\n {/* linhas */}\r\n <div\r\n style={{\r\n ...css.grid,\r\n height,\r\n backgroundImage: `repeating-linear-gradient(\r\n to bottom,\r\n ${color},\r\n ${color} 1.25px,\r\n transparent 1px,\r\n transparent ${gap}px\r\n )`,\r\n opacity,\r\n borderBottom: `1.5px solid ${color}`,\r\n transform: `rotate(${rotate}deg)`,\r\n }}\r\n />\r\n {/* Move */}\r\n <MoveLinesButton targetRef={containerRef} />\r\n </div>\r\n {/* Config */}\r\n <ConfigButton\r\n setShow={setShow}\r\n onToggleConfig={() => setShowConfig((v) => !v)}\r\n open={showConfig}\r\n />\r\n {showConfig && (\r\n <ConfigOptions\r\n rotate={rotate}\r\n setRotate={setRotate}\r\n lines={lines}\r\n gap={gap}\r\n opacity={opacity}\r\n color={color}\r\n setLines={setLines}\r\n setGap={setGap}\r\n setOpacity={setOpacity}\r\n setColor={setColor}\r\n />\r\n )}\r\n </>\r\n );\r\n}\r\n\r\nexport function LinesOverlay() {\r\n const [show, setShow] = useState(false);\r\n\r\n return (\r\n <div\r\n style={{\r\n position: \"fixed\",\r\n zIndex: 9000,\r\n bottom: 0,\r\n left: 0,\r\n width: \"100%\",\r\n height: \"100dvh\",\r\n fontFamily: \"Inter, sans-serif\",\r\n }}\r\n >\r\n <Core setShow={setShow} show={show} />\r\n\r\n <Button\r\n size=\"sm\"\r\n variant=\"ghost\"\r\n style={{\r\n ...css.triggerButton,\r\n visibility: show ? \"hidden\" : \"visible\",\r\n }}\r\n onClick={() => setShow((v) => !v)}\r\n >\r\n <Icon Icon={Eye} size=\"xl\" />\r\n Mostrar linhas - <span style={{ color: \"#787878ff\" }}>Ctrl + ;</span>\r\n </Button>\r\n </div>\r\n );\r\n}\r\n","import { Move } from 'lucide-react';\r\nimport { useRef, type MouseEvent as ReactMouseEvent, type RefObject } from 'react';\r\nimport { Button, Icon } from '../ui';\r\n\r\nconst css = {\r\n wrapper: {\r\n width: \"100%\",\r\n height: \"100%\",\r\n position: \"absolute\" as const,\r\n left: 0,\r\n top: 0,\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n justifyContent: \"center\",\r\n pointerEvents: \"auto\",\r\n },\r\n button: {\r\n backgroundColor: \"rgba(255,255,255,0.75)\",\r\n backdropFilter: \"blur(2px)\",\r\n borderRadius: 9999,\r\n },\r\n} as const;\r\n\r\nexport function MoveLinesButton({\r\n targetRef,\r\n}: {\r\n targetRef: RefObject<HTMLDivElement | null>;\r\n}) {\r\n const dragging = useRef(false);\r\n const last = useRef({ x: 0, y: 0 });\r\n\r\n function onMouseDown(e: ReactMouseEvent<HTMLButtonElement>) {\r\n dragging.current = true;\r\n last.current = { x: e.clientX, y: e.clientY };\r\n document.addEventListener(\"mousemove\", onMove);\r\n document.addEventListener(\"mouseup\", onUp);\r\n }\r\n\r\n function onMove(e: MouseEvent) {\r\n if (!dragging.current || !targetRef.current) return;\r\n\r\n const dx = e.clientX - last.current.x;\r\n const dy = e.clientY - last.current.y;\r\n\r\n const el = targetRef.current;\r\n\r\n el.style.left = `${el.offsetLeft + dx}px`;\r\n el.style.top = `${el.offsetTop + dy}px`;\r\n\r\n last.current = { x: e.clientX, y: e.clientY };\r\n }\r\n\r\n function onUp() {\r\n dragging.current = false;\r\n document.removeEventListener(\"mousemove\", onMove);\r\n document.removeEventListener(\"mouseup\", onUp);\r\n }\r\n\r\n return (\r\n <div style={css.wrapper}>\r\n <Button\r\n size=\"icon-sm\"\r\n data-black\r\n variant=\"ghost\"\r\n onMouseDown={onMouseDown}\r\n style={css.button}\r\n >\r\n <Icon Icon={Move} size=\"3xl\" strokeWidth=\"2\" />\r\n </Button>\r\n </div>\r\n );\r\n}","import * as React from 'react';\r\n\r\ntype ButtonVariant = 'default' | 'ghost' | 'transparent';\r\ntype ButtonSize = 'default' | 'sm' | 'icon-sm';\r\n\r\nconst styles = {\r\n base: {\r\n width: 'auto',\r\n display: 'inline-flex',\r\n alignItems: 'center',\r\n justifyContent: 'center',\r\n gap: 8,\n borderRadius: 4,\n position: 'relative',\r\n outline: 'none',\r\n userSelect: 'none',\r\n } satisfies React.CSSProperties,\r\n\r\n variants: {\r\n default: {\r\n backgroundColor: '#0ea5e9',\r\n color: '#ffffff',\r\n },\r\n ghost: {\r\n backgroundColor: 'transparent',\r\n color: '#111827',\r\n border: '1px solid #e5e7eb',\r\n },\r\n transparent: {\r\n backgroundColor: 'transparent',\r\n color: '#0ea5e9',\r\n },\r\n } satisfies Record<ButtonVariant, React.CSSProperties>,\r\n\r\n sizes: {\r\n default: {\r\n minHeight: 40,\r\n paddingInline: 12,\r\n paddingBlock: 12 * 0.73438 / 0.93,\r\n },\r\n sm: {\r\n minHeight: 36,\r\n paddingInline: 12,\r\n paddingBlock: 10,\r\n },\r\n 'icon-sm': {\r\n width: 32,\r\n height: 32,\r\n padding: 0,\r\n },\r\n } satisfies Record<ButtonSize, React.CSSProperties>,\r\n\r\n selected: {\r\n border: '2px solid #60a5fa',\r\n color: '#0ea5e9',\r\n backgroundColor: 'rgba(59,130,246,0.08)',\r\n } satisfies React.CSSProperties,\r\n\r\n closeButton: {\r\n color: '#0f172a',\r\n } satisfies React.CSSProperties,\r\n};\r\n\r\n\r\nexport interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\r\n asChild?: boolean;\r\n selected?: boolean;\r\n disabled?: boolean;\r\n closeButton?: boolean;\r\n variant?: ButtonVariant;\r\n size?: ButtonSize;\r\n}\r\n\r\ntype ResolveButtonStyleParams = {\r\n variant: ButtonVariant;\r\n size: ButtonSize;\r\n selected?: boolean;\r\n disabled?: boolean;\r\n closeButton?: boolean;\r\n style?: React.CSSProperties;\r\n};\r\n\r\nexport function resolveButtonStyles({\r\n variant,\r\n size,\r\n selected,\r\n disabled,\r\n closeButton,\r\n style,\r\n}: ResolveButtonStyleParams): React.CSSProperties {\r\n return {\r\n ...styles.base,\r\n ...styles.variants[variant],\r\n ...styles.sizes[size],\r\n ...(disabled && { opacity: 0.6, cursor: 'not-allowed' }),\r\n ...(selected && styles.selected),\r\n ...(closeButton && styles.closeButton),\r\n ...style,\r\n };\r\n}\r\n\r\ntype SlotProps = React.HTMLAttributes<HTMLElement> & {\r\n children?: React.ReactNode;\r\n};\r\n\r\nconst Slot = React.forwardRef<HTMLElement, SlotProps>(\r\n ({ children, className, style, ...slotProps }, ref) => {\r\n if (!children || !React.isValidElement(children)) {\r\n return null;\r\n }\r\n\r\n const child = children as React.ReactElement<any>;\r\n const mergedClassName = [className, child.props.className].filter(Boolean).join(' ');\r\n const mergedStyle = { ...style, ...child.props.style };\r\n\r\n return React.cloneElement(child, {\r\n ...slotProps,\r\n ...child.props,\r\n className: mergedClassName || undefined,\r\n style: mergedStyle,\r\n ref,\r\n });\r\n },\r\n);\r\n\r\n\r\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\r\n (\r\n {\r\n className,\r\n variant = 'default',\r\n size = 'default',\r\n asChild = false,\r\n selected = false,\r\n disabled = false,\r\n closeButton = false,\r\n style,\r\n ...props\r\n },\r\n ref,\r\n ) => {\r\n const Comp = asChild ? Slot : 'button';\r\n\r\n return (\r\n <Comp\r\n ref={ref}\r\n className={className}\r\n disabled={disabled}\r\n style={resolveButtonStyles({\r\n variant,\r\n size,\r\n selected,\r\n disabled,\r\n closeButton,\r\n style,\r\n })}\r\n {...props}\r\n />\r\n );\r\n },\r\n);\r\n\r\n","import type { LucideIcon as LucideIconType, LucideProps } from 'lucide-react';\r\n\r\ntype StrokeWidthValue = keyof typeof weights;\r\nconst weights = {\r\n thin: 2.25,\r\n light: 2.35,\r\n normal: 2.65,\r\n semibold: 2.75,\r\n bold: 2.85,\r\n extrabold: 3,\r\n};\r\n\r\ntype SizeValue = keyof typeof iconSizes;\r\n\r\nconst iconSizes = {\r\n xs: '0.937em',\r\n sm: '0.968em',\r\n base: '1em',\r\n md: '1.033em',\r\n lg: '1.067em',\r\n xl: '1.138em',\r\n '2xl': '1.215em',\r\n '3xl': '1.296em',\r\n h6: '1.067em',\r\n h5: '1.138em',\r\n h4: '1.215em',\r\n h3: '1.296em',\r\n h2: '1.383em',\r\n h1: '1.4757em',\r\n};\r\n\r\nconst css = {\r\n wrapper: {\r\n height: '0.75rem',\r\n display: 'inline-flex',\r\n justifyContent: 'center',\r\n alignItems: 'center',\r\n overflow: 'visible' as const,\r\n },\r\n} as const;\r\n\r\ninterface IconProps extends Omit<LucideProps, 'size' | 'strokeWidth'> {\r\n Icon: LucideIconType;\r\n size?: SizeValue | string;\r\n strokeWidth?: StrokeWidthValue | string;\r\n}\r\n\r\nexport const Icon = ({ Icon, size, className, strokeWidth, fill }: IconProps) => {\r\n return (\r\n <div data-icon style={css.wrapper}>\r\n <Icon\r\n size={iconSizes[size as SizeValue] || size || '1.067em'}\r\n strokeWidth={weights[strokeWidth as StrokeWidthValue] || strokeWidth || 2.6}\r\n className={className}\r\n fill={fill || 'none'}\r\n />\r\n </div>\r\n );\r\n};\r\n","import * as React from 'react';\r\n\r\nconst css = {\r\n base: {\r\n flexShrink: 0,\r\n backgroundColor: '#e5e7eb',\r\n },\r\n horizontal: {\r\n height: 1,\r\n width: '100%',\r\n },\r\n vertical: {\r\n height: '100%',\r\n width: 1,\r\n },\r\n} as const;\r\n\r\ntype SeparatorProps = React.HTMLAttributes<HTMLDivElement> & {\r\n orientation?: 'horizontal' | 'vertical';\r\n decorative?: boolean;\r\n};\r\n\r\nconst Separator = React.forwardRef<HTMLDivElement, SeparatorProps>(\r\n ({ className, orientation = 'horizontal', decorative = true, style, ...props }, ref) => {\r\n const dimensionStyle = orientation === 'horizontal' ? css.horizontal : css.vertical;\r\n\r\n const ariaProps = decorative\r\n ? { role: 'none' as const }\r\n : {\r\n role: 'separator' as const,\r\n 'aria-orientation': orientation,\r\n };\r\n\r\n return (\r\n <div\r\n ref={ref}\r\n style={{ ...css.base, ...dimensionStyle, ...style }}\r\n className={className}\r\n {...ariaProps}\r\n {...props}\r\n />\r\n );\r\n },\r\n);\r\nSeparator.displayName = 'Separator';\r\n\r\nexport { Separator };\r\n","import { ChevronDown, ChevronUp, X } from 'lucide-react';\nimport type { MouseEvent } from 'react';\nimport type { StateSetter } from '../../types';\nimport { Button, Icon, Separator } from '../ui/index';\n\nconst css = {\n container: {\n position: \"fixed\",\n bottom: 8,\n right: 8,\n zIndex: 9999,\n pointerEvents: \"auto\",\n height: 40,\n border: \"1px solid rgba(148,163,184,0.5)\",\n backgroundColor: \"rgba(255,255,255,0.70)\",\n boxShadow: \"0 1px 3px rgba(15,23,42,0.2)\",\n display: \"flex\",\n alignItems: \"center\",\n paddingLeft: 14,\n paddingRight: 4,\n borderRadius: 4,\n },\n label: {\n fontWeight: 600,\n letterSpacing: \"0.03em\",\n paddingRight: 8,\n fontSize: 14,\n userSelect: \"none\",\n },\n buttonsRow: {\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n gap: 4,\n },\n closeIcon: {\n color: \"#dc2626\",\n },\n} as const;\n\nexport function ConfigButton({\n onToggleConfig,\n open,\n setShow,\n}: {\n open: boolean;\n onToggleConfig: () => void;\n setShow: StateSetter<boolean>;\n}) {\n const handleClick = (e: MouseEvent<HTMLButtonElement>, item: number) => {\n if (item === 1) {\n onToggleConfig();\n } else {\n e.stopPropagation();\n setShow((v) => !v);\n }\n };\n\n return (\n <div style={css.container}>\n <span\n style={css.label}\n onClick={(e) => {\n e.stopPropagation();\n onToggleConfig();\n }}\n >\n Configurar\n </span>\n\n <div style={css.buttonsRow}>\n {[1, 2, 3].map((item) =>\n item !== 2 ? (\n <Button\n style={{\n outlineWidth: 1,\n }}\n variant={\"transparent\"}\n size=\"icon-sm\"\n data-black\n key={item}\n onClick={(e) => {\n handleClick(e, item);\n }}\n >\n {item === 1 ? (\n <Icon\n Icon={open ? ChevronDown : ChevronUp}\n size={\"xl\"}\n strokeWidth=\"light\"\n />\n ) : (\n <Icon Icon={X} size=\"sm\" strokeWidth=\"light\" />\n )}\n </Button>\n ) : (\n <Separator orientation=\"vertical\" />\n )\n )}\n </div>\n </div>\n );\n}\n","import { RotateCw } from \"lucide-react\";\r\nimport { Button, Icon } from \"../ui\";\r\nimport { type ConfigOptionsProps, NUMBER_FIELDS, colorOptions } from \"./data\";\r\n\r\nconst css = {\r\n container: {\r\n position: \"fixed\",\r\n bottom: 52,\r\n right: 8,\r\n zIndex: 1000,\r\n pointerEvents: \"auto\",\r\n backgroundColor: \"rgba(255,255,255,0.94)\",\r\n backdropFilter: \"blur(4px)\",\r\n boxShadow: \"0 4px 6px rgba(15,23,42,0.12)\",\r\n border: \"1px solid rgba(148,163,184,0.3)\",\r\n borderRadius: 8,\r\n paddingInline: 12,\r\n paddingBlock: 10,\r\n width: \"auto\",\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n gap: 4,\r\n },\r\n fieldRow: {\r\n width: \"100%\",\r\n marginBottom: 12,\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n gap: 8,\r\n },\r\n wrapper: {\r\n display: \"flex\",\r\n alignItems: \"flex-end\",\r\n gap: 8,\r\n borderRadius: 4,\r\n },\r\n inputWrapper: {\r\n width: 104,\r\n },\r\n label: {\r\n display: \"block\",\r\n fontWeight: 500,\r\n marginBottom: 4,\r\n fontSize: 14,\r\n },\r\n numberInput: {\r\n width: \"100%\",\r\n height: 32,\r\n borderRadius: 4,\r\n border: \"1px solid #e5e7eb\",\r\n paddingInline: 8,\r\n boxSizing: \"border-box\",\r\n },\r\n quickRow: {\r\n display: \"flex\",\r\n gap: 6,\r\n marginTop: 4,\r\n },\r\n quickButton: {\r\n fontWeight: 500,\r\n borderRadius: 999,\r\n },\r\n colorSection: {\r\n marginBottom: 12,\r\n },\r\n colorLabel: {\r\n display: \"block\",\r\n fontWeight: 500,\r\n marginBottom: 4,\r\n fontSize: 14,\r\n },\r\n colorRow: {\r\n display: \"flex\",\r\n gap: 8,\r\n },\r\n colorDot: {\r\n display: \"block\",\r\n width: \"80%\",\r\n height: \"80%\",\r\n borderRadius: 999,\r\n },\r\n} as const;\r\n\r\nexport function ConfigOptions(props: ConfigOptionsProps) {\r\n const fieldBindings = {\r\n lines: { value: props.lines, set: props.setLines },\r\n gap: { value: props.gap, set: props.setGap },\r\n opacity: { value: props.opacity, set: props.setOpacity },\r\n };\r\n\r\n return (\r\n <div style={css.container}>\r\n {NUMBER_FIELDS.map((field) => {\r\n const binding = fieldBindings[field.key];\r\n\r\n return (\r\n <div style={css.fieldRow} key={field.key}>\r\n <div style={css.wrapper}>\r\n <div style={css.inputWrapper}>\r\n <label style={css.label}>{field.label}</label>\r\n <input\r\n style={css.numberInput}\r\n type=\"number\"\r\n step={field.step}\r\n value={binding.value}\r\n onChange={(e) => binding.set(+e.target.value)}\r\n />\r\n </div>\r\n <div style={css.quickRow}>\r\n {field.quick.map((v) => {\r\n return (\r\n <Button\r\n selected={binding.value === v}\r\n key={v}\r\n data-option\r\n variant=\"ghost\"\r\n size=\"icon-sm\"\r\n style={css.quickButton}\r\n onClick={() => binding.set(v)}\r\n >\r\n {v}\r\n </Button>\r\n );\r\n })}\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n })}\r\n\r\n <div style={css.colorSection}>\r\n <span style={css.colorLabel}>Cor</span>\r\n <div style={css.colorRow}>\r\n {colorOptions.map((c) => (\r\n <Button\r\n style={{ borderRadius: 999 }}\r\n key={c.value}\r\n variant=\"ghost\"\r\n size=\"icon-sm\"\r\n title={c.name}\r\n onClick={() => props.setColor(c.value)}\r\n >\r\n <span style={{ ...css.colorDot, backgroundColor: c.value }} />\r\n </Button>\r\n ))}\r\n </div>\r\n </div>\r\n\r\n <Button\r\n variant=\"ghost\"\r\n size=\"sm\"\r\n style={{ maxWidth: \"max-content\" }}\r\n onClick={() => {\r\n if (props.rotate === 0) {\r\n props.setRotate(90);\r\n } else {\r\n props.setRotate(0);\r\n }\r\n }}\r\n >\r\n <Icon Icon={RotateCw} /> Rotacionar\r\n </Button>\r\n </div>\r\n );\r\n}\r\n","export type FieldBinding = {\r\n value: number;\r\n set: (v: number) => void;\r\n};\r\n\r\nexport type ConfigOptionsProps = {\r\n lines: number;\r\n gap: number;\r\n opacity: number;\r\n color: string;\r\n setLines: (v: number) => void;\r\n setGap: (v: number) => void;\r\n setOpacity: (v: number) => void;\r\n setColor: (v: string) => void;\r\n rotate: number;\r\n setRotate: (v: number) => void;\r\n};\r\n\r\nexport type NumberFieldConfig = {\r\n key: 'lines' | 'gap' | 'opacity';\r\n label: string;\r\n step?: number;\r\n quick: number[];\r\n};\r\n\r\nexport const NUMBER_FIELDS: NumberFieldConfig[] = [\r\n {\r\n key: 'lines',\r\n label: 'Linhas',\r\n quick: [2, 4, 8, 12],\r\n step: 4,\r\n },\r\n {\r\n key: 'gap',\r\n label: 'Gap',\r\n quick: [16, 24, 32, 40, 44],\r\n step: 4,\r\n },\r\n {\r\n key: 'opacity',\r\n label: 'Opacidade',\r\n quick: [0.2, 0.3, 0.5, 0.7],\r\n step: 0.05,\r\n },\r\n];\r\n\r\nexport const colorOptions = [\r\n { name: 'Azul', value: '#2563eb' },\r\n { name: 'Amarelo', value: '#eab308' },\r\n { name: 'Verde', value: '#16a34a' },\r\n { name: 'Roxo', value: '#7c3aed' },\r\n { name: 'Violeta', value: '#9333ea' },\r\n { name: 'Violeta', value: '#d71212' },\r\n];\r\n"],"mappings":";AAAA,SAAS,WAAW;AACpB,SAAS,WAAW,UAAAA,SAAQ,gBAAgB;;;ACD5C,SAAS,YAAY;AACrB,SAAS,cAAkE;;;ACD3E,YAAY,WAAW;AAgJjB;AA3IN,IAAM,SAAS;AAAA,EACb,MAAM;AAAA,IACJ,OAAO;AAAA,I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EA,gBAAAA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,gBAAgB,MAAM,cAAc,CAAC,MAAM,CAAC,CAAC;AAAA,QAC7C,MAAM;AAAA;AAAA,IACR;AAAA,IACC,cACC,gBAAAA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA,KAEJ;AAEJ;AAEO,SAAS,eAAe;AAC7B,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,KAAK;AAEtC,SACE,gBAAAC;AAAA,IAAC;AAAA;AAAA,MACC,OAAO;AAAA,QACL,UAAU;AAAA,QACV,QAAQ;AAAA,QACR,QAAQ;AAAA,QACR,MAAM;AAAA,QACN,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,YAAY;AAAA,MACd;AAAA,MAEA;AAAA,wBAAAD,KAAC,QAAK,SAAkB,MAAY;AAAA,QAEpC,gBAAAC;AAAA,UAAC;AAAA;AAAA,YACC,MAAK;AAAA,YACL,SAAQ;AAAA,YACR,OAAO;AAAA,cACL,GAAGC,KAAI;AAAA,cACP,YAAY,OAAO,WAAW;AAAA,YAChC;AAAA,YACA,SAAS,MAAM,QAAQ,CAAC,MAAM,CAAC,CAAC;AAAA,YAEhC;AAAA,8BAAAF,KAAC,QAAK,MAAM,KAAK,MAAK,MAAK;AAAA,cAAE;AAAA,cACZ,gBAAAA,KAAC,UAAK,OAAO,EAAE,OAAO,YAAY,GAAG,sBAAQ;AAAA;AAAA;AAAA,QAChE;AAAA;AAAA;AAAA,EACF;AAEJ;","names":["useRef","jsx","Icon","React","jsx","css","jsx","css","jsx","css","jsx","jsxs","css","jsx","jsxs","css","useRef"]}
|
package/package.json
CHANGED
|
@@ -23,12 +23,8 @@ const css = {
|
|
|
23
23
|
|
|
24
24
|
export function MoveLinesButton({
|
|
25
25
|
targetRef,
|
|
26
|
-
color,
|
|
27
|
-
opacity,
|
|
28
26
|
}: {
|
|
29
27
|
targetRef: RefObject<HTMLDivElement | null>;
|
|
30
|
-
color: string;
|
|
31
|
-
opacity: number;
|
|
32
28
|
}) {
|
|
33
29
|
const dragging = useRef(false);
|
|
34
30
|
const last = useRef({ x: 0, y: 0 });
|
|
@@ -71,17 +67,6 @@ export function MoveLinesButton({
|
|
|
71
67
|
>
|
|
72
68
|
<Icon Icon={Move} size="3xl" strokeWidth="2" />
|
|
73
69
|
</Button>
|
|
74
|
-
<div
|
|
75
|
-
style={{
|
|
76
|
-
width: "100%",
|
|
77
|
-
height: 1.25,
|
|
78
|
-
position: "absolute",
|
|
79
|
-
left: 0,
|
|
80
|
-
bottom: 0,
|
|
81
|
-
backgroundColor: color,
|
|
82
|
-
opacity,
|
|
83
|
-
}}
|
|
84
|
-
/>
|
|
85
70
|
</div>
|
|
86
71
|
);
|
|
87
72
|
}
|
package/src/lines-overlay.tsx
CHANGED
|
@@ -76,15 +76,12 @@ function Core({ show, setShow }: Props) {
|
|
|
76
76
|
transparent ${gap}px
|
|
77
77
|
)`,
|
|
78
78
|
opacity,
|
|
79
|
+
borderBottom: `1.5px solid ${color}`,
|
|
79
80
|
transform: `rotate(${rotate}deg)`,
|
|
80
81
|
}}
|
|
81
82
|
/>
|
|
82
83
|
{/* Move */}
|
|
83
|
-
<MoveLinesButton
|
|
84
|
-
targetRef={containerRef}
|
|
85
|
-
color={color}
|
|
86
|
-
opacity={opacity}
|
|
87
|
-
/>
|
|
84
|
+
<MoveLinesButton targetRef={containerRef} />
|
|
88
85
|
</div>
|
|
89
86
|
{/* Config */}
|
|
90
87
|
<ConfigButton
|