lines-overlay 0.1.20 → 0.1.22

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.
Files changed (47) hide show
  1. package/dist/index.d.mts +5 -0
  2. package/dist/index.d.ts +5 -1
  3. package/dist/index.js +674 -1
  4. package/dist/index.js.map +1 -0
  5. package/dist/index.mjs +637 -0
  6. package/dist/index.mjs.map +1 -0
  7. package/package.json +11 -11
  8. package/{components → src/components}/config-button.tsx +1 -1
  9. package/{components → src/components}/config-options.tsx +0 -1
  10. package/{components → src/components}/move-lines-button.tsx +22 -23
  11. package/{lines-overlay.tsx → src/lines-overlay.tsx} +32 -24
  12. package/{ui → src/ui}/button.tsx +0 -1
  13. package/tsconfig.json +2 -2
  14. package/tsup.config.ts +17 -0
  15. package/dist/components/config-button.d.ts +0 -6
  16. package/dist/components/config-button.js +0 -51
  17. package/dist/components/config-options.d.ts +0 -2
  18. package/dist/components/config-options.js +0 -101
  19. package/dist/components/data.d.ts +0 -25
  20. package/dist/components/data.js +0 -28
  21. package/dist/components/index.d.ts +0 -3
  22. package/dist/components/index.js +0 -3
  23. package/dist/components/move-lines-button.d.ts +0 -4
  24. package/dist/components/move-lines-button.js +0 -44
  25. package/dist/lines-overlay.d.ts +0 -1
  26. package/dist/lines-overlay.js +0 -65
  27. package/dist/types.d.ts +0 -3
  28. package/dist/types.js +0 -1
  29. package/dist/ui/button.d.ts +0 -22
  30. package/dist/ui/button.js +0 -93
  31. package/dist/ui/buttons-wrapper.d.ts +0 -8
  32. package/dist/ui/buttons-wrapper.js +0 -13
  33. package/dist/ui/index.d.ts +0 -3
  34. package/dist/ui/index.js +0 -3
  35. package/dist/ui/lucide-icon.d.ts +0 -34
  36. package/dist/ui/lucide-icon.js +0 -37
  37. package/dist/ui/separator.d.ts +0 -6
  38. package/dist/ui/separator.js +0 -28
  39. package/index.css +0 -0
  40. /package/{comandos.txt → src/comandos.txt} +0 -0
  41. /package/{components → src/components}/data.ts +0 -0
  42. /package/{components → src/components}/index.ts +0 -0
  43. /package/{index.ts → src/index.ts} +0 -0
  44. /package/{ui → src/ui}/buttons-wrapper.tsx +0 -0
  45. /package/{ui → src/ui}/index.ts +0 -0
  46. /package/{ui → src/ui}/lucide-icon.tsx +0 -0
  47. /package/{ui → src/ui}/separator.tsx +0 -0
@@ -0,0 +1,5 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ declare function RowGrid(): react_jsx_runtime.JSX.Element;
4
+
5
+ export { RowGrid };
package/dist/index.d.ts CHANGED
@@ -1 +1,5 @@
1
- export { RowGrid } from "./lines-overlay";
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ declare function RowGrid(): react_jsx_runtime.JSX.Element;
4
+
5
+ export { RowGrid };
package/dist/index.js CHANGED
@@ -1 +1,674 @@
1
- export { RowGrid } from "./lines-overlay";
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
+ RowGrid: () => RowGrid
34
+ });
35
+ module.exports = __toCommonJS(index_exports);
36
+
37
+ // src/lines-overlay.tsx
38
+ var import_lucide_react3 = require("lucide-react");
39
+ var import_react2 = require("react");
40
+
41
+ // src/components/move-lines-button.tsx
42
+ var import_lucide_react = require("lucide-react");
43
+ var import_react = require("react");
44
+
45
+ // src/ui/button.tsx
46
+ var React = __toESM(require("react"));
47
+ var import_jsx_runtime = require("react/jsx-runtime");
48
+ var styles = {
49
+ base: {
50
+ width: "auto",
51
+ display: "inline-flex",
52
+ alignItems: "center",
53
+ justifyContent: "center",
54
+ gap: 8,
55
+ borderRadius: 6,
56
+ position: "relative",
57
+ outline: "none",
58
+ userSelect: "none"
59
+ },
60
+ variants: {
61
+ default: {
62
+ backgroundColor: "#0ea5e9",
63
+ color: "#ffffff"
64
+ },
65
+ ghost: {
66
+ backgroundColor: "transparent",
67
+ color: "#111827",
68
+ border: "1px solid #e5e7eb"
69
+ },
70
+ transparent: {
71
+ backgroundColor: "transparent",
72
+ color: "#0ea5e9"
73
+ }
74
+ },
75
+ sizes: {
76
+ default: {
77
+ minHeight: 40,
78
+ paddingInline: 12,
79
+ paddingBlock: 12 * 0.73438 / 0.93
80
+ },
81
+ sm: {
82
+ minHeight: 36,
83
+ paddingInline: 12,
84
+ paddingBlock: 10
85
+ },
86
+ "icon-sm": {
87
+ width: 32,
88
+ height: 32,
89
+ padding: 0
90
+ }
91
+ },
92
+ selected: {
93
+ border: "2px solid #60a5fa",
94
+ color: "#0ea5e9",
95
+ backgroundColor: "rgba(59,130,246,0.08)"
96
+ },
97
+ closeButton: {
98
+ color: "#0f172a"
99
+ }
100
+ };
101
+ function resolveButtonStyles({
102
+ variant,
103
+ size,
104
+ selected,
105
+ disabled,
106
+ closeButton,
107
+ style
108
+ }) {
109
+ return {
110
+ ...styles.base,
111
+ ...styles.variants[variant],
112
+ ...styles.sizes[size],
113
+ ...disabled && { opacity: 0.6, cursor: "not-allowed" },
114
+ ...selected && styles.selected,
115
+ ...closeButton && styles.closeButton,
116
+ ...style
117
+ };
118
+ }
119
+ var Slot = React.forwardRef(
120
+ ({ children, className, style, ...slotProps }, ref) => {
121
+ if (!children || !React.isValidElement(children)) {
122
+ return null;
123
+ }
124
+ const child = children;
125
+ const mergedClassName = [className, child.props.className].filter(Boolean).join(" ");
126
+ const mergedStyle = { ...style, ...child.props.style };
127
+ return React.cloneElement(child, {
128
+ ...slotProps,
129
+ ...child.props,
130
+ className: mergedClassName || void 0,
131
+ style: mergedStyle,
132
+ ref
133
+ });
134
+ }
135
+ );
136
+ var Button = React.forwardRef(
137
+ ({
138
+ className,
139
+ variant = "default",
140
+ size = "default",
141
+ asChild = false,
142
+ selected = false,
143
+ disabled = false,
144
+ closeButton = false,
145
+ style,
146
+ ...props
147
+ }, ref) => {
148
+ const Comp = asChild ? Slot : "button";
149
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
150
+ Comp,
151
+ {
152
+ ref,
153
+ className,
154
+ disabled,
155
+ style: resolveButtonStyles({
156
+ variant,
157
+ size,
158
+ selected,
159
+ disabled,
160
+ closeButton,
161
+ style
162
+ }),
163
+ ...props
164
+ }
165
+ );
166
+ }
167
+ );
168
+
169
+ // src/ui/lucide-icon.tsx
170
+ var import_jsx_runtime2 = require("react/jsx-runtime");
171
+ var weights = {
172
+ thin: 2.25,
173
+ light: 2.35,
174
+ normal: 2.65,
175
+ semibold: 2.75,
176
+ bold: 2.85,
177
+ extrabold: 3
178
+ };
179
+ var iconSizes = {
180
+ xs: "0.937em",
181
+ sm: "0.968em",
182
+ base: "1em",
183
+ md: "1.033em",
184
+ lg: "1.067em",
185
+ xl: "1.138em",
186
+ "2xl": "1.215em",
187
+ "3xl": "1.296em",
188
+ h6: "1.067em",
189
+ h5: "1.138em",
190
+ h4: "1.215em",
191
+ h3: "1.296em",
192
+ h2: "1.383em",
193
+ h1: "1.4757em"
194
+ };
195
+ var css = {
196
+ wrapper: {
197
+ height: "0.75rem",
198
+ display: "inline-flex",
199
+ justifyContent: "center",
200
+ alignItems: "center",
201
+ overflow: "visible"
202
+ }
203
+ };
204
+ var Icon = ({ Icon: Icon2, size, className, strokeWidth, fill }) => {
205
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { "data-icon": true, style: css.wrapper, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
206
+ Icon2,
207
+ {
208
+ size: iconSizes[size] || size || "1.067em",
209
+ strokeWidth: weights[strokeWidth] || strokeWidth || 2.6,
210
+ className,
211
+ fill: fill || "none"
212
+ }
213
+ ) });
214
+ };
215
+
216
+ // src/ui/separator.tsx
217
+ var React2 = __toESM(require("react"));
218
+ var import_jsx_runtime3 = require("react/jsx-runtime");
219
+ var css2 = {
220
+ base: {
221
+ flexShrink: 0,
222
+ backgroundColor: "#e5e7eb"
223
+ },
224
+ horizontal: {
225
+ height: 1,
226
+ width: "100%"
227
+ },
228
+ vertical: {
229
+ height: "100%",
230
+ width: 1
231
+ }
232
+ };
233
+ var Separator = React2.forwardRef(
234
+ ({ className, orientation = "horizontal", decorative = true, style, ...props }, ref) => {
235
+ const dimensionStyle = orientation === "horizontal" ? css2.horizontal : css2.vertical;
236
+ const ariaProps = decorative ? { role: "none" } : {
237
+ role: "separator",
238
+ "aria-orientation": orientation
239
+ };
240
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
241
+ "div",
242
+ {
243
+ ref,
244
+ style: { ...css2.base, ...dimensionStyle, ...style },
245
+ className,
246
+ ...ariaProps,
247
+ ...props
248
+ }
249
+ );
250
+ }
251
+ );
252
+ Separator.displayName = "Separator";
253
+
254
+ // src/components/move-lines-button.tsx
255
+ var import_jsx_runtime4 = require("react/jsx-runtime");
256
+ var css3 = {
257
+ wrapper: {
258
+ position: "absolute",
259
+ left: "50%",
260
+ top: "44%",
261
+ transform: "translate(-50%, -50%)",
262
+ pointerEvents: "auto"
263
+ },
264
+ button: {
265
+ backgroundColor: "rgba(255,255,255,0.75)",
266
+ backdropFilter: "blur(2px)"
267
+ }
268
+ };
269
+ function MoveLinesButton({ targetRef }) {
270
+ const dragging = (0, import_react.useRef)(false);
271
+ const last = (0, import_react.useRef)({ x: 0, y: 0 });
272
+ function onMouseDown(e) {
273
+ dragging.current = true;
274
+ last.current = { x: e.clientX, y: e.clientY };
275
+ document.addEventListener("mousemove", onMove);
276
+ document.addEventListener("mouseup", onUp);
277
+ }
278
+ function onMove(e) {
279
+ if (!dragging.current || !targetRef.current) return;
280
+ const dx = e.clientX - last.current.x;
281
+ const dy = e.clientY - last.current.y;
282
+ const el = targetRef.current;
283
+ el.style.left = `${el.offsetLeft + dx}px`;
284
+ el.style.top = `${el.offsetTop + dy}px`;
285
+ last.current = { x: e.clientX, y: e.clientY };
286
+ }
287
+ function onUp() {
288
+ dragging.current = false;
289
+ document.removeEventListener("mousemove", onMove);
290
+ document.removeEventListener("mouseup", onUp);
291
+ }
292
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { style: css3.wrapper, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
293
+ Button,
294
+ {
295
+ size: "icon-sm",
296
+ "data-black": true,
297
+ variant: "ghost",
298
+ onMouseDown,
299
+ style: css3.button,
300
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { Icon: import_lucide_react.Move, size: "lg", strokeWidth: "thin" })
301
+ }
302
+ ) });
303
+ }
304
+
305
+ // src/components/config-button.tsx
306
+ var import_lucide_react2 = require("lucide-react");
307
+ var import_jsx_runtime5 = require("react/jsx-runtime");
308
+ var css4 = {
309
+ container: {
310
+ position: "fixed",
311
+ bottom: 8,
312
+ right: 8,
313
+ zIndex: 9999,
314
+ pointerEvents: "auto",
315
+ height: 40,
316
+ borderWidth: 1,
317
+ borderStyle: "solid",
318
+ borderColor: "rgba(148,163,184,0.8)",
319
+ backgroundColor: "rgba(255,255,255,0.70)",
320
+ boxShadow: "0 1px 3px rgba(15,23,42,0.2)",
321
+ display: "flex",
322
+ alignItems: "center",
323
+ paddingLeft: 14,
324
+ paddingRight: 4
325
+ },
326
+ label: {
327
+ fontWeight: 500,
328
+ fontSize: "0.8125rem",
329
+ letterSpacing: "0.03em",
330
+ paddingRight: 8
331
+ },
332
+ buttonsRow: {
333
+ height: "100%",
334
+ display: "flex",
335
+ alignItems: "center",
336
+ gap: 4
337
+ },
338
+ closeIcon: {
339
+ color: "#dc2626"
340
+ }
341
+ };
342
+ function ConfigButton({
343
+ onToggleConfig,
344
+ open,
345
+ setShow
346
+ }) {
347
+ const handleClick = (e, item) => {
348
+ if (item === 1) {
349
+ onToggleConfig();
350
+ } else {
351
+ e.stopPropagation();
352
+ setShow((v) => !v);
353
+ }
354
+ };
355
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: css4.container, children: [
356
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { style: css4.label, children: "Configurar" }),
357
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: css4.buttonsRow, children: [1, 2, 3].map(
358
+ (item) => item !== 2 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
359
+ Button,
360
+ {
361
+ variant: "transparent",
362
+ size: "icon-sm",
363
+ "data-black": true,
364
+ onClick: (e) => {
365
+ handleClick(e, item);
366
+ },
367
+ children: item === 1 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { Icon: open ? import_lucide_react2.ChevronDown : import_lucide_react2.ChevronUp, size: "xl", strokeWidth: "light" }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { Icon: import_lucide_react2.X, size: "sm", strokeWidth: "light", className: void 0 })
368
+ },
369
+ item
370
+ ) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Separator, { orientation: "vertical" })
371
+ ) })
372
+ ] });
373
+ }
374
+
375
+ // src/components/data.ts
376
+ var NUMBER_FIELDS = [
377
+ {
378
+ key: "lines",
379
+ label: "Linhas",
380
+ quick: [2, 4, 8, 12],
381
+ step: 4
382
+ },
383
+ {
384
+ key: "gap",
385
+ label: "Gap",
386
+ quick: [16, 24, 32, 40, 44],
387
+ step: 4
388
+ },
389
+ {
390
+ key: "opacity",
391
+ label: "Opacidade",
392
+ quick: [0.2, 0.3, 0.5, 0.7],
393
+ step: 0.05
394
+ }
395
+ ];
396
+ var colorOptions = [
397
+ { name: "Azul", value: "#2563eb" },
398
+ { name: "Amarelo", value: "#eab308" },
399
+ { name: "Verde", value: "#16a34a" },
400
+ { name: "Roxo", value: "#7c3aed" },
401
+ { name: "Violeta", value: "#9333ea" },
402
+ { name: "Violeta", value: "#d71212" }
403
+ ];
404
+
405
+ // src/components/config-options.tsx
406
+ var import_jsx_runtime6 = require("react/jsx-runtime");
407
+ var css5 = {
408
+ container: {
409
+ position: "fixed",
410
+ bottom: 52,
411
+ right: 8,
412
+ zIndex: 1e3,
413
+ pointerEvents: "auto",
414
+ fontSize: "0.875rem",
415
+ backgroundColor: "rgba(255,255,255,0.94)",
416
+ backdropFilter: "blur(4px)",
417
+ boxShadow: "0 4px 6px rgba(15,23,42,0.12)",
418
+ borderWidth: 1,
419
+ borderStyle: "solid",
420
+ borderColor: "rgba(148,163,184,0.5)",
421
+ paddingInline: 12,
422
+ paddingBlock: 8,
423
+ width: "auto",
424
+ display: "flex",
425
+ flexDirection: "column",
426
+ gap: 8
427
+ },
428
+ fieldRow: {
429
+ width: "100%",
430
+ borderBottomWidth: 1,
431
+ borderBottomStyle: "solid",
432
+ borderBottomColor: "rgba(148,163,184,0.4)",
433
+ paddingBottom: 12,
434
+ display: "flex",
435
+ flexDirection: "column",
436
+ gap: 4
437
+ },
438
+ wrapper: {
439
+ display: "flex",
440
+ alignItems: "flex-end",
441
+ gap: 8,
442
+ borderRadius: 6
443
+ },
444
+ inputWrapper: {
445
+ width: 104
446
+ },
447
+ label: {
448
+ display: "block",
449
+ fontSize: "0.75rem",
450
+ fontWeight: 500,
451
+ marginBottom: 4
452
+ },
453
+ numberInput: {
454
+ width: "100%",
455
+ height: 32,
456
+ borderRadius: 6,
457
+ borderWidth: 1,
458
+ borderStyle: "solid",
459
+ borderColor: "#e5e7eb",
460
+ paddingInline: 8,
461
+ fontSize: "0.875rem"
462
+ },
463
+ quickRow: {
464
+ display: "flex",
465
+ gap: 5,
466
+ marginTop: 4
467
+ },
468
+ quickButton: {
469
+ fontWeight: 500,
470
+ fontSize: "0.875rem"
471
+ },
472
+ colorSection: {
473
+ marginTop: 8
474
+ },
475
+ colorLabel: {
476
+ display: "block",
477
+ fontSize: "0.75rem",
478
+ fontWeight: 500,
479
+ marginBottom: 4
480
+ },
481
+ colorRow: {
482
+ display: "flex",
483
+ gap: 8
484
+ },
485
+ colorDot: {
486
+ display: "block",
487
+ width: "80%",
488
+ height: "80%"
489
+ }
490
+ };
491
+ function ConfigOptions(props) {
492
+ const fieldBindings = {
493
+ lines: { value: props.lines, set: props.setLines },
494
+ gap: { value: props.gap, set: props.setGap },
495
+ opacity: { value: props.opacity, set: props.setOpacity }
496
+ };
497
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: css5.container, children: [
498
+ NUMBER_FIELDS.map((field) => {
499
+ const binding = fieldBindings[field.key];
500
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: css5.fieldRow, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: css5.wrapper, children: [
501
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: css5.inputWrapper, children: [
502
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("label", { style: css5.label, children: field.label }),
503
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
504
+ "input",
505
+ {
506
+ style: css5.numberInput,
507
+ type: "number",
508
+ step: field.step,
509
+ value: binding.value,
510
+ onChange: (e) => binding.set(+e.target.value)
511
+ }
512
+ )
513
+ ] }),
514
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: css5.quickRow, children: field.quick.map((v) => {
515
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
516
+ Button,
517
+ {
518
+ selected: binding.value === v,
519
+ "data-option": true,
520
+ variant: "ghost",
521
+ size: "icon-sm",
522
+ style: css5.quickButton,
523
+ onClick: () => binding.set(v),
524
+ children: v
525
+ },
526
+ v
527
+ );
528
+ }) })
529
+ ] }) }, field.key);
530
+ }),
531
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: css5.colorSection, children: [
532
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { style: css5.colorLabel, children: "Cor" }),
533
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: css5.colorRow, children: colorOptions.map((c) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
534
+ Button,
535
+ {
536
+ variant: "ghost",
537
+ size: "icon-sm",
538
+ title: c.name,
539
+ onClick: () => props.setColor(c.value),
540
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { style: { ...css5.colorDot, backgroundColor: c.value } })
541
+ },
542
+ c.value
543
+ )) })
544
+ ] })
545
+ ] });
546
+ }
547
+
548
+ // src/lines-overlay.tsx
549
+ var import_jsx_runtime7 = require("react/jsx-runtime");
550
+ var css6 = {
551
+ overlay: {
552
+ position: "absolute",
553
+ top: 100,
554
+ left: 0,
555
+ width: "100%",
556
+ pointerEvents: "none",
557
+ display: "flex",
558
+ justifyContent: "center",
559
+ zIndex: 10
560
+ },
561
+ grid: {
562
+ width: "100%"
563
+ },
564
+ triggerButton: {
565
+ position: "absolute",
566
+ bottom: 8,
567
+ right: 8,
568
+ zIndex: 20,
569
+ fontSize: "1rem",
570
+ backgroundColor: "rgba(255,255,255,0.70)"
571
+ }
572
+ };
573
+ function RowGridCore({ show, setShow }) {
574
+ const containerRef = (0, import_react2.useRef)(null);
575
+ const [lines, setLines] = (0, import_react2.useState)(12);
576
+ const [gap, setGap] = (0, import_react2.useState)(24);
577
+ const [opacity, setOpacity] = (0, import_react2.useState)(0.3);
578
+ const [color, setColor] = (0, import_react2.useState)("#d71212");
579
+ const [showConfig, setShowConfig] = (0, import_react2.useState)(false);
580
+ (0, import_react2.useEffect)(() => {
581
+ const handler = (e) => {
582
+ if (e.ctrlKey && e.key === ";") {
583
+ setShow((v) => !v);
584
+ }
585
+ };
586
+ window.addEventListener("keydown", handler);
587
+ return () => window.removeEventListener("keydown", handler);
588
+ }, []);
589
+ if (!show) return null;
590
+ const height = lines * gap;
591
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
592
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { ref: containerRef, style: { ...css6.overlay, height }, children: [
593
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
594
+ "div",
595
+ {
596
+ style: {
597
+ ...css6.grid,
598
+ height,
599
+ backgroundImage: `repeating-linear-gradient(
600
+ to bottom,
601
+ ${color},
602
+ ${color} 1px,
603
+ transparent 1px,
604
+ transparent ${gap}px
605
+ )`,
606
+ opacity
607
+ }
608
+ }
609
+ ),
610
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(MoveLinesButton, { targetRef: containerRef })
611
+ ] }),
612
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
613
+ ConfigButton,
614
+ {
615
+ setShow,
616
+ onToggleConfig: () => setShowConfig((v) => !v),
617
+ open: showConfig
618
+ }
619
+ ),
620
+ showConfig && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
621
+ ConfigOptions,
622
+ {
623
+ lines,
624
+ gap,
625
+ opacity,
626
+ color,
627
+ setLines,
628
+ setGap,
629
+ setOpacity,
630
+ setColor
631
+ }
632
+ )
633
+ ] });
634
+ }
635
+ function RowGrid() {
636
+ const [show, setShow] = (0, import_react2.useState)(false);
637
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
638
+ "div",
639
+ {
640
+ style: {
641
+ position: "fixed",
642
+ zIndex: 9e3,
643
+ bottom: 0,
644
+ left: 0,
645
+ width: "100%",
646
+ height: "100dvh"
647
+ },
648
+ children: [
649
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(RowGridCore, { setShow, show }),
650
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
651
+ Button,
652
+ {
653
+ size: "sm",
654
+ variant: "ghost",
655
+ style: {
656
+ ...css6.triggerButton,
657
+ visibility: show ? "hidden" : "visible"
658
+ },
659
+ onClick: () => setShow((v) => !v),
660
+ children: [
661
+ "Mostrar linhas",
662
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { Icon: import_lucide_react3.Eye })
663
+ ]
664
+ }
665
+ )
666
+ ]
667
+ }
668
+ );
669
+ }
670
+ // Annotate the CommonJS export names for ESM import in node:
671
+ 0 && (module.exports = {
672
+ RowGrid
673
+ });
674
+ //# sourceMappingURL=index.js.map