@tbib-image-viewer/react 0.1.4 → 0.1.6

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.mjs CHANGED
@@ -14,6 +14,7 @@ import {
14
14
  } from "@tbib-image-viewer/core";
15
15
 
16
16
  // src/components/ImageToolbar.tsx
17
+ import React2 from "react";
17
18
  import { FontAwesomeIcon as FontAwesomeIcon2 } from "@fortawesome/react-fontawesome";
18
19
  import {
19
20
  faHand,
@@ -264,251 +265,307 @@ var ImageToolbar = ({
264
265
  totalImages
265
266
  }) => {
266
267
  const showSubtoolbar = activeTool === "pen" || activeTool === "highlighter" || activeTool === "laser";
268
+ const toolbarScrollRef = React2.useRef(null);
269
+ const subtoolbarScrollRef = React2.useRef(null);
270
+ const toolbarTouchState = React2.useRef({ isDown: false, startX: 0, scrollLeft: 0 });
271
+ const subtoolbarTouchState = React2.useRef({ isDown: false, startX: 0, scrollLeft: 0 });
272
+ const handleToolbarTouchStart = (e) => {
273
+ if (!toolbarScrollRef.current) return;
274
+ toolbarTouchState.current = {
275
+ isDown: true,
276
+ startX: e.touches[0].clientX,
277
+ scrollLeft: toolbarScrollRef.current.scrollLeft
278
+ };
279
+ };
280
+ const handleToolbarTouchMove = (e) => {
281
+ if (!toolbarTouchState.current.isDown || !toolbarScrollRef.current) return;
282
+ const dx = e.touches[0].clientX - toolbarTouchState.current.startX;
283
+ toolbarScrollRef.current.scrollLeft = toolbarTouchState.current.scrollLeft - dx;
284
+ };
285
+ const handleToolbarTouchEnd = () => {
286
+ toolbarTouchState.current.isDown = false;
287
+ };
288
+ const handleSubtoolbarTouchStart = (e) => {
289
+ if (!subtoolbarScrollRef.current) return;
290
+ subtoolbarTouchState.current = {
291
+ isDown: true,
292
+ startX: e.touches[0].clientX,
293
+ scrollLeft: subtoolbarScrollRef.current.scrollLeft
294
+ };
295
+ };
296
+ const handleSubtoolbarTouchMove = (e) => {
297
+ if (!subtoolbarTouchState.current.isDown || !subtoolbarScrollRef.current) return;
298
+ const dx = e.touches[0].clientX - subtoolbarTouchState.current.startX;
299
+ subtoolbarScrollRef.current.scrollLeft = subtoolbarTouchState.current.scrollLeft - dx;
300
+ };
301
+ const handleSubtoolbarTouchEnd = () => {
302
+ subtoolbarTouchState.current.isDown = false;
303
+ };
267
304
  return /* @__PURE__ */ jsxs2("div", { className: "tbib-iv-toolbar-wrapper", children: [
268
- /* @__PURE__ */ jsxs2("header", { className: "tbib-iv-toolbar", role: "toolbar", "aria-label": "Image tools", children: [
269
- currentIndex !== void 0 && totalImages !== void 0 && totalImages > 1 && /* @__PURE__ */ jsxs2(Fragment, { children: [
270
- /* @__PURE__ */ jsxs2("span", { className: "tbib-iv-tabular", title: "Current Image", children: [
271
- currentIndex + 1,
272
- " / ",
273
- totalImages
274
- ] }),
275
- /* @__PURE__ */ jsx2("div", { className: "tbib-iv-divider" })
276
- ] }),
277
- /* @__PURE__ */ jsx2(
278
- "button",
279
- {
280
- type: "button",
281
- className: `tbib-iv-btn ${activeTool === "hand" ? "tbib-iv-btn-active" : ""}`,
282
- onClick: () => onToolChange("hand"),
283
- title: "Pan & Move (1-finger / drag)",
284
- "aria-label": "Hand Pan Tool",
285
- children: /* @__PURE__ */ jsx2(FontAwesomeIcon2, { icon: faHand })
286
- }
287
- ),
288
- /* @__PURE__ */ jsx2(
289
- "button",
290
- {
291
- type: "button",
292
- className: `tbib-iv-btn ${activeTool === "pen" ? "tbib-iv-btn-active" : ""}`,
293
- onClick: () => onToolChange("pen"),
294
- title: "Draw Pen",
295
- "aria-label": "Pen Tool",
296
- children: /* @__PURE__ */ jsx2(FontAwesomeIcon2, { icon: faPen })
297
- }
298
- ),
299
- /* @__PURE__ */ jsx2(
300
- "button",
301
- {
302
- type: "button",
303
- className: `tbib-iv-btn ${activeTool === "highlighter" ? "tbib-iv-btn-active" : ""}`,
304
- onClick: () => onToolChange("highlighter"),
305
- title: "Highlighter (Semi-transparent)",
306
- "aria-label": "Highlighter Tool",
307
- children: /* @__PURE__ */ jsx2(FontAwesomeIcon2, { icon: faHighlighter })
308
- }
309
- ),
310
- /* @__PURE__ */ jsx2(
311
- "button",
312
- {
313
- type: "button",
314
- className: `tbib-iv-btn ${activeTool === "laser" ? "tbib-iv-btn-active" : ""}`,
315
- onClick: () => onToolChange("laser"),
316
- title: "Laser Pointer (Glowing WebGL trail)",
317
- "aria-label": "Laser Pointer",
318
- children: /* @__PURE__ */ jsx2(FontAwesomeIcon2, { icon: faCrosshairs })
319
- }
320
- ),
321
- /* @__PURE__ */ jsx2(
322
- "button",
323
- {
324
- type: "button",
325
- className: `tbib-iv-btn ${activeTool === "eraser" ? "tbib-iv-btn-active" : ""}`,
326
- onClick: () => onToolChange("eraser"),
327
- title: "Eraser (Erase strokes on tap)",
328
- "aria-label": "Eraser Tool",
329
- children: /* @__PURE__ */ jsx2(FontAwesomeIcon2, { icon: faEraser })
330
- }
331
- ),
332
- /* @__PURE__ */ jsx2("div", { className: "tbib-iv-divider" }),
333
- /* @__PURE__ */ jsx2(
334
- "button",
335
- {
336
- type: "button",
337
- className: "tbib-iv-btn",
338
- disabled: !canUndo,
339
- onClick: onUndo,
340
- title: "Undo (Ctrl+Z)",
341
- "aria-label": "Undo",
342
- children: /* @__PURE__ */ jsx2(FontAwesomeIcon2, { icon: faRotateLeft })
343
- }
344
- ),
345
- /* @__PURE__ */ jsx2(
346
- "button",
347
- {
348
- type: "button",
349
- className: "tbib-iv-btn",
350
- disabled: !canRedo,
351
- onClick: onRedo,
352
- title: "Redo (Ctrl+Y)",
353
- "aria-label": "Redo",
354
- children: /* @__PURE__ */ jsx2(FontAwesomeIcon2, { icon: faRotateRight })
355
- }
356
- ),
357
- /* @__PURE__ */ jsx2(
358
- "button",
359
- {
360
- type: "button",
361
- className: "tbib-iv-btn",
362
- onClick: onClear,
363
- title: "Clear Slide Annotations",
364
- "aria-label": "Clear All",
365
- children: /* @__PURE__ */ jsx2(FontAwesomeIcon2, { icon: faTrashCan })
366
- }
367
- ),
368
- /* @__PURE__ */ jsx2("div", { className: "tbib-iv-divider" }),
369
- /* @__PURE__ */ jsx2(
370
- "button",
371
- {
372
- type: "button",
373
- className: "tbib-iv-btn",
374
- onClick: onZoomOut,
375
- title: "Zoom Out (-)",
376
- "aria-label": "Zoom Out",
377
- children: /* @__PURE__ */ jsx2(FontAwesomeIcon2, { icon: faMagnifyingGlassMinus })
378
- }
379
- ),
380
- /* @__PURE__ */ jsxs2("span", { className: "tbib-iv-tabular", title: "Current Zoom Scale", children: [
381
- Math.round(zoomScale * 100),
382
- "%"
383
- ] }),
384
- /* @__PURE__ */ jsx2(
385
- "button",
386
- {
387
- type: "button",
388
- className: "tbib-iv-btn",
389
- onClick: onZoomIn,
390
- title: "Zoom In (+)",
391
- "aria-label": "Zoom In",
392
- children: /* @__PURE__ */ jsx2(FontAwesomeIcon2, { icon: faMagnifyingGlassPlus })
393
- }
394
- ),
395
- /* @__PURE__ */ jsx2(
396
- "button",
397
- {
398
- type: "button",
399
- className: "tbib-iv-btn",
400
- onClick: onZoomReset,
401
- title: "Reset Fit to Screen (0)",
402
- "aria-label": "Reset Zoom",
403
- children: /* @__PURE__ */ jsx2(FontAwesomeIcon2, { icon: faExpand })
404
- }
405
- ),
406
- /* @__PURE__ */ jsx2(
407
- "button",
408
- {
409
- type: "button",
410
- className: "tbib-iv-btn",
411
- onClick: onRotate,
412
- title: "Rotate 90\xB0 Clockwise",
413
- "aria-label": "Rotate Image",
414
- children: /* @__PURE__ */ jsx2(FontAwesomeIcon2, { icon: faRotate })
415
- }
416
- ),
417
- /* @__PURE__ */ jsx2("div", { className: "tbib-iv-divider" }),
418
- /* @__PURE__ */ jsx2(
419
- DownloadMenu,
420
- {
421
- onDownloadAnnotated,
422
- onDownloadClean,
423
- onExportJson
424
- }
425
- ),
426
- onToggleFullscreen && /* @__PURE__ */ jsx2(
427
- "button",
428
- {
429
- type: "button",
430
- className: "tbib-iv-btn",
431
- onClick: onToggleFullscreen,
432
- title: isFullscreen ? "Exit Fullscreen" : "Enter Fullscreen",
433
- "aria-label": "Toggle Fullscreen",
434
- children: /* @__PURE__ */ jsx2(FontAwesomeIcon2, { icon: isFullscreen ? faCompressAlt : faExpandAlt })
435
- }
436
- ),
437
- onClose && /* @__PURE__ */ jsxs2(Fragment, { children: [
438
- /* @__PURE__ */ jsx2("div", { className: "tbib-iv-divider" }),
439
- /* @__PURE__ */ jsx2(
440
- "button",
441
- {
442
- type: "button",
443
- className: "tbib-iv-btn",
444
- onClick: onClose,
445
- title: "Close Viewer (Esc)",
446
- "aria-label": "Close",
447
- style: { color: "#ef4444" },
448
- children: /* @__PURE__ */ jsx2(FontAwesomeIcon2, { icon: faXmark, style: { fontSize: "16px" } })
449
- }
450
- )
451
- ] })
452
- ] }),
453
- showSubtoolbar && /* @__PURE__ */ jsxs2("div", { className: "tbib-iv-subtoolbar", role: "region", "aria-label": "Tool customization", children: [
454
- activeTool !== "laser" && /* @__PURE__ */ jsx2("div", { className: "tbib-iv-thickness-group", children: THICKNESS_OPTIONS.map((opt) => /* @__PURE__ */ jsxs2(
455
- "button",
456
- {
457
- type: "button",
458
- className: `tbib-iv-thickness-btn ${strokeWidth === opt.value ? "tbib-iv-thickness-active" : ""}`,
459
- onClick: () => onStrokeWidthChange(opt.value),
460
- title: `${opt.label} stroke (${opt.value}px)`,
461
- children: [
305
+ /* @__PURE__ */ jsx2("header", { className: "tbib-iv-toolbar", role: "toolbar", "aria-label": "Image tools", children: /* @__PURE__ */ jsxs2(
306
+ "div",
307
+ {
308
+ ref: toolbarScrollRef,
309
+ className: "tbib-iv-toolbar-scroll",
310
+ onTouchStart: handleToolbarTouchStart,
311
+ onTouchMove: handleToolbarTouchMove,
312
+ onTouchEnd: handleToolbarTouchEnd,
313
+ children: [
314
+ currentIndex !== void 0 && totalImages !== void 0 && totalImages > 1 && /* @__PURE__ */ jsxs2(Fragment, { children: [
315
+ /* @__PURE__ */ jsxs2("span", { className: "tbib-iv-tabular", title: "Current Image", children: [
316
+ currentIndex + 1,
317
+ " / ",
318
+ totalImages
319
+ ] }),
320
+ /* @__PURE__ */ jsx2("div", { className: "tbib-iv-divider" })
321
+ ] }),
322
+ /* @__PURE__ */ jsx2(
323
+ "button",
324
+ {
325
+ type: "button",
326
+ className: `tbib-iv-btn ${activeTool === "hand" ? "tbib-iv-btn-active" : ""}`,
327
+ onClick: () => onToolChange("hand"),
328
+ title: "Pan & Move (1-finger / drag)",
329
+ "aria-label": "Hand Pan Tool",
330
+ children: /* @__PURE__ */ jsx2(FontAwesomeIcon2, { icon: faHand })
331
+ }
332
+ ),
333
+ /* @__PURE__ */ jsx2(
334
+ "button",
335
+ {
336
+ type: "button",
337
+ className: `tbib-iv-btn ${activeTool === "pen" ? "tbib-iv-btn-active" : ""}`,
338
+ onClick: () => onToolChange("pen"),
339
+ title: "Draw Pen",
340
+ "aria-label": "Pen Tool",
341
+ children: /* @__PURE__ */ jsx2(FontAwesomeIcon2, { icon: faPen })
342
+ }
343
+ ),
344
+ /* @__PURE__ */ jsx2(
345
+ "button",
346
+ {
347
+ type: "button",
348
+ className: `tbib-iv-btn ${activeTool === "highlighter" ? "tbib-iv-btn-active" : ""}`,
349
+ onClick: () => onToolChange("highlighter"),
350
+ title: "Highlighter (Semi-transparent)",
351
+ "aria-label": "Highlighter Tool",
352
+ children: /* @__PURE__ */ jsx2(FontAwesomeIcon2, { icon: faHighlighter })
353
+ }
354
+ ),
355
+ /* @__PURE__ */ jsx2(
356
+ "button",
357
+ {
358
+ type: "button",
359
+ className: `tbib-iv-btn ${activeTool === "laser" ? "tbib-iv-btn-active" : ""}`,
360
+ onClick: () => onToolChange("laser"),
361
+ title: "Laser Pointer (Glowing WebGL trail)",
362
+ "aria-label": "Laser Pointer",
363
+ children: /* @__PURE__ */ jsx2(FontAwesomeIcon2, { icon: faCrosshairs })
364
+ }
365
+ ),
366
+ /* @__PURE__ */ jsx2(
367
+ "button",
368
+ {
369
+ type: "button",
370
+ className: `tbib-iv-btn ${activeTool === "eraser" ? "tbib-iv-btn-active" : ""}`,
371
+ onClick: () => onToolChange("eraser"),
372
+ title: "Eraser (Erase strokes on tap)",
373
+ "aria-label": "Eraser Tool",
374
+ children: /* @__PURE__ */ jsx2(FontAwesomeIcon2, { icon: faEraser })
375
+ }
376
+ ),
377
+ /* @__PURE__ */ jsx2("div", { className: "tbib-iv-divider" }),
378
+ /* @__PURE__ */ jsx2(
379
+ "button",
380
+ {
381
+ type: "button",
382
+ className: "tbib-iv-btn",
383
+ disabled: !canUndo,
384
+ onClick: onUndo,
385
+ title: "Undo (Ctrl+Z)",
386
+ "aria-label": "Undo",
387
+ children: /* @__PURE__ */ jsx2(FontAwesomeIcon2, { icon: faRotateLeft })
388
+ }
389
+ ),
390
+ /* @__PURE__ */ jsx2(
391
+ "button",
392
+ {
393
+ type: "button",
394
+ className: "tbib-iv-btn",
395
+ disabled: !canRedo,
396
+ onClick: onRedo,
397
+ title: "Redo (Ctrl+Y)",
398
+ "aria-label": "Redo",
399
+ children: /* @__PURE__ */ jsx2(FontAwesomeIcon2, { icon: faRotateRight })
400
+ }
401
+ ),
402
+ /* @__PURE__ */ jsx2(
403
+ "button",
404
+ {
405
+ type: "button",
406
+ className: "tbib-iv-btn",
407
+ onClick: onClear,
408
+ title: "Clear Slide Annotations",
409
+ "aria-label": "Clear All",
410
+ children: /* @__PURE__ */ jsx2(FontAwesomeIcon2, { icon: faTrashCan })
411
+ }
412
+ ),
413
+ /* @__PURE__ */ jsx2("div", { className: "tbib-iv-divider" }),
414
+ /* @__PURE__ */ jsx2(
415
+ "button",
416
+ {
417
+ type: "button",
418
+ className: "tbib-iv-btn",
419
+ onClick: onZoomOut,
420
+ title: "Zoom Out (-)",
421
+ "aria-label": "Zoom Out",
422
+ children: /* @__PURE__ */ jsx2(FontAwesomeIcon2, { icon: faMagnifyingGlassMinus })
423
+ }
424
+ ),
425
+ /* @__PURE__ */ jsxs2("span", { className: "tbib-iv-tabular", title: "Current Zoom Scale", children: [
426
+ Math.round(zoomScale * 100),
427
+ "%"
428
+ ] }),
429
+ /* @__PURE__ */ jsx2(
430
+ "button",
431
+ {
432
+ type: "button",
433
+ className: "tbib-iv-btn",
434
+ onClick: onZoomIn,
435
+ title: "Zoom In (+)",
436
+ "aria-label": "Zoom In",
437
+ children: /* @__PURE__ */ jsx2(FontAwesomeIcon2, { icon: faMagnifyingGlassPlus })
438
+ }
439
+ ),
440
+ /* @__PURE__ */ jsx2(
441
+ "button",
442
+ {
443
+ type: "button",
444
+ className: "tbib-iv-btn",
445
+ onClick: onZoomReset,
446
+ title: "Reset Fit to Screen (0)",
447
+ "aria-label": "Reset Zoom",
448
+ children: /* @__PURE__ */ jsx2(FontAwesomeIcon2, { icon: faExpand })
449
+ }
450
+ ),
451
+ /* @__PURE__ */ jsx2(
452
+ "button",
453
+ {
454
+ type: "button",
455
+ className: "tbib-iv-btn",
456
+ onClick: onRotate,
457
+ title: "Rotate 90\xB0 Clockwise",
458
+ "aria-label": "Rotate Image",
459
+ children: /* @__PURE__ */ jsx2(FontAwesomeIcon2, { icon: faRotate })
460
+ }
461
+ ),
462
+ /* @__PURE__ */ jsx2("div", { className: "tbib-iv-divider" }),
463
+ /* @__PURE__ */ jsx2(
464
+ DownloadMenu,
465
+ {
466
+ onDownloadAnnotated,
467
+ onDownloadClean,
468
+ onExportJson
469
+ }
470
+ ),
471
+ onToggleFullscreen && /* @__PURE__ */ jsx2(
472
+ "button",
473
+ {
474
+ type: "button",
475
+ className: "tbib-iv-btn",
476
+ onClick: onToggleFullscreen,
477
+ title: isFullscreen ? "Exit Fullscreen" : "Enter Fullscreen",
478
+ "aria-label": "Toggle Fullscreen",
479
+ children: /* @__PURE__ */ jsx2(FontAwesomeIcon2, { icon: isFullscreen ? faCompressAlt : faExpandAlt })
480
+ }
481
+ ),
482
+ onClose && /* @__PURE__ */ jsxs2(Fragment, { children: [
483
+ /* @__PURE__ */ jsx2("div", { className: "tbib-iv-divider" }),
462
484
  /* @__PURE__ */ jsx2(
463
- "span",
485
+ "button",
464
486
  {
465
- style: {
466
- display: "inline-block",
467
- width: `${Math.min(opt.value * 1.5, 12)}px`,
468
- height: `${Math.min(opt.value * 1.5, 12)}px`,
469
- borderRadius: "50%",
470
- backgroundColor: "currentColor"
471
- }
487
+ type: "button",
488
+ className: "tbib-iv-btn",
489
+ onClick: onClose,
490
+ title: "Close Viewer (Esc)",
491
+ "aria-label": "Close",
492
+ style: { color: "#ef4444" },
493
+ children: /* @__PURE__ */ jsx2(FontAwesomeIcon2, { icon: faXmark, style: { fontSize: "16px" } })
472
494
  }
473
- ),
474
- /* @__PURE__ */ jsx2("span", { children: opt.label })
475
- ]
476
- },
477
- opt.value
478
- )) }),
479
- activeTool === "laser" && /* @__PURE__ */ jsx2("span", { style: { fontSize: "11px", color: "var(--tbib-iv-text-muted)", fontStyle: "italic", paddingRight: "4px" }, children: "Laser Beam Color:" }),
480
- /* @__PURE__ */ jsx2("div", { className: "tbib-iv-divider", style: { height: "16px", margin: "0 2px" } }),
481
- /* @__PURE__ */ jsxs2("div", { style: { display: "inline-flex", alignItems: "center", gap: "6px" }, children: [
482
- PRESET_COLORS.map((c) => {
483
- const isSelected = color.toLowerCase() === c.toLowerCase();
484
- return /* @__PURE__ */ jsx2(
495
+ )
496
+ ] })
497
+ ]
498
+ }
499
+ ) }),
500
+ showSubtoolbar && /* @__PURE__ */ jsx2("div", { className: "tbib-iv-subtoolbar", role: "region", "aria-label": "Tool customization", children: /* @__PURE__ */ jsxs2(
501
+ "div",
502
+ {
503
+ ref: subtoolbarScrollRef,
504
+ className: "tbib-iv-subtoolbar-scroll",
505
+ onTouchStart: handleSubtoolbarTouchStart,
506
+ onTouchMove: handleSubtoolbarTouchMove,
507
+ onTouchEnd: handleSubtoolbarTouchEnd,
508
+ children: [
509
+ activeTool !== "laser" && /* @__PURE__ */ jsx2("div", { className: "tbib-iv-thickness-group", children: THICKNESS_OPTIONS.map((opt) => /* @__PURE__ */ jsxs2(
485
510
  "button",
486
511
  {
487
512
  type: "button",
488
- className: `tbib-iv-swatch-btn ${isSelected ? "tbib-iv-swatch-active" : ""}`,
489
- style: { backgroundColor: c },
490
- onClick: () => onColorChange(c),
491
- title: `Select color: ${c}`,
492
- "aria-label": `Color ${c}`
513
+ className: `tbib-iv-thickness-btn ${strokeWidth === opt.value ? "tbib-iv-thickness-active" : ""}`,
514
+ onClick: () => onStrokeWidthChange(opt.value),
515
+ title: `${opt.label} stroke (${opt.value}px)`,
516
+ children: [
517
+ /* @__PURE__ */ jsx2(
518
+ "span",
519
+ {
520
+ style: {
521
+ display: "inline-block",
522
+ width: `${Math.min(opt.value * 1.5, 12)}px`,
523
+ height: `${Math.min(opt.value * 1.5, 12)}px`,
524
+ borderRadius: "50%",
525
+ backgroundColor: "currentColor"
526
+ }
527
+ }
528
+ ),
529
+ /* @__PURE__ */ jsx2("span", { children: opt.label })
530
+ ]
493
531
  },
494
- c
495
- );
496
- }),
497
- /* @__PURE__ */ jsxs2("label", { className: "tbib-iv-custom-color-btn", title: "Custom Color Picker", children: [
498
- /* @__PURE__ */ jsx2(FontAwesomeIcon2, { icon: faEyeDropper, style: { fontSize: "10px", opacity: 0.8 } }),
499
- /* @__PURE__ */ jsx2(
500
- "input",
501
- {
502
- type: "color",
503
- value: color,
504
- onChange: (e) => onColorChange(e.target.value),
505
- className: "tbib-iv-custom-color-input",
506
- "aria-label": "Custom color picker"
507
- }
508
- )
509
- ] })
510
- ] })
511
- ] })
532
+ opt.value
533
+ )) }),
534
+ activeTool === "laser" && /* @__PURE__ */ jsx2("span", { style: { fontSize: "11px", color: "var(--tbib-iv-text-muted)", fontStyle: "italic", paddingRight: "4px" }, children: "Laser Beam Color:" }),
535
+ /* @__PURE__ */ jsx2("div", { className: "tbib-iv-divider", style: { height: "16px", margin: "0 2px" } }),
536
+ /* @__PURE__ */ jsxs2("div", { style: { display: "inline-flex", alignItems: "center", gap: "6px" }, children: [
537
+ PRESET_COLORS.map((c) => {
538
+ const isSelected = color.toLowerCase() === c.toLowerCase();
539
+ return /* @__PURE__ */ jsx2(
540
+ "button",
541
+ {
542
+ type: "button",
543
+ className: `tbib-iv-swatch-btn ${isSelected ? "tbib-iv-swatch-active" : ""}`,
544
+ style: { backgroundColor: c },
545
+ onClick: () => onColorChange(c),
546
+ title: `Select color: ${c}`,
547
+ "aria-label": `Color ${c}`
548
+ },
549
+ c
550
+ );
551
+ }),
552
+ /* @__PURE__ */ jsxs2("label", { className: "tbib-iv-custom-color-btn", title: "Custom Color Picker", children: [
553
+ /* @__PURE__ */ jsx2(FontAwesomeIcon2, { icon: faEyeDropper, style: { fontSize: "10px", opacity: 0.8 } }),
554
+ /* @__PURE__ */ jsx2(
555
+ "input",
556
+ {
557
+ type: "color",
558
+ value: color,
559
+ onChange: (e) => onColorChange(e.target.value),
560
+ className: "tbib-iv-custom-color-input",
561
+ "aria-label": "Custom color picker"
562
+ }
563
+ )
564
+ ] })
565
+ ] })
566
+ ]
567
+ }
568
+ ) })
512
569
  ] });
513
570
  };
514
571