@multiplatform.one/components 10.1.1 → 10.1.3

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 (130) hide show
  1. package/dist/cjs/MiddleEllipsisText/index.native.cjs +5 -1
  2. package/dist/cjs/MiddleEllipsisText/index.native.js +5 -1
  3. package/dist/cjs/MiddleEllipsisText/index.native.js.map +1 -1
  4. package/dist/cjs/Tabs/index.cjs +3 -2
  5. package/dist/cjs/Tabs/index.native.cjs +3 -2
  6. package/dist/cjs/Tabs/index.native.js +3 -2
  7. package/dist/cjs/Tabs/index.native.js.map +1 -1
  8. package/dist/cjs/layouts/timeline.cjs +0 -1
  9. package/dist/cjs/layouts/timeline.native.cjs +0 -1
  10. package/dist/cjs/layouts/timeline.native.js +0 -1
  11. package/dist/cjs/layouts/timeline.native.js.map +1 -1
  12. package/dist/cjs/views/Calendar.cjs +54 -76
  13. package/dist/cjs/views/Calendar.native.cjs +54 -76
  14. package/dist/cjs/views/Calendar.native.js +54 -76
  15. package/dist/cjs/views/Calendar.native.js.map +1 -1
  16. package/dist/cjs/views/Gantt.cjs +185 -69
  17. package/dist/cjs/views/Gantt.native.cjs +190 -72
  18. package/dist/cjs/views/Gantt.native.js +190 -72
  19. package/dist/cjs/views/Gantt.native.js.map +1 -1
  20. package/dist/cjs/views/GanttDateGrip.cjs +20 -14
  21. package/dist/cjs/views/GanttDateGrip.native.cjs +24 -14
  22. package/dist/cjs/views/GanttDateGrip.native.js +24 -14
  23. package/dist/cjs/views/GanttDateGrip.native.js.map +1 -1
  24. package/dist/cjs/views/GanttGripDot.cjs +43 -0
  25. package/dist/cjs/views/GanttGripDot.native.cjs +46 -0
  26. package/dist/cjs/views/GanttGripDot.native.js +48 -0
  27. package/dist/cjs/views/GanttGripDot.native.js.map +1 -0
  28. package/dist/cjs/views/eventTint.cjs +242 -0
  29. package/dist/cjs/views/eventTint.native.cjs +346 -0
  30. package/dist/cjs/views/eventTint.native.js +348 -0
  31. package/dist/cjs/views/eventTint.native.js.map +1 -0
  32. package/dist/esm/MiddleEllipsisText/index.native.js +2 -1
  33. package/dist/esm/MiddleEllipsisText/index.native.js.map +1 -1
  34. package/dist/esm/Tabs/index.mjs +3 -2
  35. package/dist/esm/Tabs/index.mjs.map +1 -1
  36. package/dist/esm/Tabs/index.native.js +3 -2
  37. package/dist/esm/Tabs/index.native.js.map +1 -1
  38. package/dist/esm/layouts/timeline.mjs +0 -1
  39. package/dist/esm/layouts/timeline.mjs.map +1 -1
  40. package/dist/esm/layouts/timeline.native.js +0 -1
  41. package/dist/esm/layouts/timeline.native.js.map +1 -1
  42. package/dist/esm/views/Calendar.mjs +53 -75
  43. package/dist/esm/views/Calendar.mjs.map +1 -1
  44. package/dist/esm/views/Calendar.native.js +53 -75
  45. package/dist/esm/views/Calendar.native.js.map +1 -1
  46. package/dist/esm/views/Gantt.mjs +186 -70
  47. package/dist/esm/views/Gantt.mjs.map +1 -1
  48. package/dist/esm/views/Gantt.native.js +191 -73
  49. package/dist/esm/views/Gantt.native.js.map +1 -1
  50. package/dist/esm/views/GanttDateGrip.mjs +21 -15
  51. package/dist/esm/views/GanttDateGrip.mjs.map +1 -1
  52. package/dist/esm/views/GanttDateGrip.native.js +25 -15
  53. package/dist/esm/views/GanttDateGrip.native.js.map +1 -1
  54. package/dist/esm/views/GanttGripDot.mjs +24 -0
  55. package/dist/esm/views/GanttGripDot.mjs.map +1 -0
  56. package/dist/esm/views/GanttGripDot.native.js +25 -0
  57. package/dist/esm/views/GanttGripDot.native.js.map +1 -0
  58. package/dist/esm/views/eventTint.mjs +196 -0
  59. package/dist/esm/views/eventTint.mjs.map +1 -0
  60. package/dist/esm/views/eventTint.native.js +298 -0
  61. package/dist/esm/views/eventTint.native.js.map +1 -0
  62. package/dist/jsx/MiddleEllipsisText/index.native.cjs +5 -1
  63. package/dist/jsx/MiddleEllipsisText/index.native.js +5 -1
  64. package/dist/jsx/MiddleEllipsisText/index.native.js.map +1 -1
  65. package/dist/jsx/Tabs/index.mjs +3 -2
  66. package/dist/jsx/Tabs/index.mjs.map +1 -1
  67. package/dist/jsx/Tabs/index.native.cjs +3 -2
  68. package/dist/jsx/Tabs/index.native.js +3 -2
  69. package/dist/jsx/Tabs/index.native.js.map +1 -1
  70. package/dist/jsx/layouts/timeline.mjs +0 -1
  71. package/dist/jsx/layouts/timeline.mjs.map +1 -1
  72. package/dist/jsx/layouts/timeline.native.cjs +0 -1
  73. package/dist/jsx/layouts/timeline.native.js +0 -1
  74. package/dist/jsx/layouts/timeline.native.js.map +1 -1
  75. package/dist/jsx/views/Calendar.mjs +53 -75
  76. package/dist/jsx/views/Calendar.mjs.map +1 -1
  77. package/dist/jsx/views/Calendar.native.cjs +54 -76
  78. package/dist/jsx/views/Calendar.native.js +54 -76
  79. package/dist/jsx/views/Calendar.native.js.map +1 -1
  80. package/dist/jsx/views/Gantt.mjs +186 -70
  81. package/dist/jsx/views/Gantt.mjs.map +1 -1
  82. package/dist/jsx/views/Gantt.native.cjs +190 -72
  83. package/dist/jsx/views/Gantt.native.js +190 -72
  84. package/dist/jsx/views/Gantt.native.js.map +1 -1
  85. package/dist/jsx/views/GanttDateGrip.mjs +21 -15
  86. package/dist/jsx/views/GanttDateGrip.mjs.map +1 -1
  87. package/dist/jsx/views/GanttDateGrip.native.cjs +24 -14
  88. package/dist/jsx/views/GanttDateGrip.native.js +24 -14
  89. package/dist/jsx/views/GanttDateGrip.native.js.map +1 -1
  90. package/dist/jsx/views/GanttGripDot.mjs +24 -0
  91. package/dist/jsx/views/GanttGripDot.mjs.map +1 -0
  92. package/dist/jsx/views/GanttGripDot.native.cjs +46 -0
  93. package/dist/jsx/views/GanttGripDot.native.js +48 -0
  94. package/dist/jsx/views/GanttGripDot.native.js.map +1 -0
  95. package/dist/jsx/views/eventTint.mjs +196 -0
  96. package/dist/jsx/views/eventTint.mjs.map +1 -0
  97. package/dist/jsx/views/eventTint.native.cjs +346 -0
  98. package/dist/jsx/views/eventTint.native.js +348 -0
  99. package/dist/jsx/views/eventTint.native.js.map +1 -0
  100. package/package.json +7 -7
  101. package/src/MiddleEllipsisText/MiddleEllipsisText.native.spec.tsx +9 -0
  102. package/src/MiddleEllipsisText/index.native.tsx +1 -0
  103. package/src/Tabs/Tabs.measurement.spec.tsx +40 -1
  104. package/src/Tabs/index.tsx +3 -2
  105. package/src/hoverTouchPath.coarse.spec.tsx +28 -4
  106. package/src/layouts/timeline.replyInset.spec.tsx +72 -22
  107. package/src/layouts/timeline.tsx +0 -1
  108. package/src/views/Calendar.eventFill.spec.tsx +44 -9
  109. package/src/views/Calendar.tsx +23 -31
  110. package/src/views/Gantt.barInk.spec.tsx +257 -0
  111. package/src/views/Gantt.grips.spec.tsx +226 -0
  112. package/src/views/Gantt.tint.palette.spec.ts +288 -0
  113. package/src/views/Gantt.tsx +224 -65
  114. package/src/views/GanttDateGrip.native.spec.tsx +8 -0
  115. package/src/views/GanttDateGrip.tsx +28 -17
  116. package/src/views/GanttGripDot.tsx +36 -0
  117. package/src/views/dataIdentity.spec.tsx +29 -13
  118. package/src/views/eventTint.ts +305 -0
  119. package/types/MiddleEllipsisText/index.native.d.ts +1 -0
  120. package/types/MiddleEllipsisText/index.native.d.ts.map +1 -1
  121. package/types/Tabs/index.d.ts.map +1 -1
  122. package/types/layouts/timeline.d.ts.map +1 -1
  123. package/types/views/Calendar.d.ts.map +1 -1
  124. package/types/views/Gantt.d.ts.map +1 -1
  125. package/types/views/GanttDateGrip.d.ts +7 -0
  126. package/types/views/GanttDateGrip.d.ts.map +1 -1
  127. package/types/views/GanttGripDot.d.ts +9 -0
  128. package/types/views/GanttGripDot.d.ts.map +1 -0
  129. package/types/views/eventTint.d.ts +72 -0
  130. package/types/views/eventTint.d.ts.map +1 -0
@@ -9,7 +9,6 @@ import {
9
9
  hairline,
10
10
  hairlineWidth,
11
11
  keyboardFocusRingProps,
12
- useReadableTextOn,
13
12
  useChartPalette,
14
13
  useResolvedKnobs,
15
14
  wasKeyboardFocus,
@@ -39,6 +38,18 @@ import { LinearGradient } from "tamagui/linear-gradient";
39
38
  import { normalizeColor } from "@tamagui/core";
40
39
  import { useTheme, getTokenValue } from "tamagui";
41
40
  import { GanttDateGrip } from "./GanttDateGrip";
41
+ import { GanttGripDot } from "./GanttGripDot";
42
+ import {
43
+ EVENT_BAR_PX,
44
+ EVENT_GRIP_DOT_PX,
45
+ eventLabelInk,
46
+ eventPaint,
47
+ eventSolid,
48
+ eventStripPaint,
49
+ useEventDark,
50
+ type EventState,
51
+ type EventThemeValues,
52
+ } from "./eventTint";
42
53
  import { intervalViewport, intervalEdgeX, type GanttSnapUnit } from "./ganttIntervals";
43
54
  import {
44
55
  addDays,
@@ -410,48 +421,92 @@ function BarIntentWrap({
410
421
  return <Intent name={intent}>{children}</Intent>;
411
422
  }
412
423
 
413
- /** Title ink on a filled bar — paper or ink, whichever clears AA on the fill. */
414
- function GanttBarLabel({ title, fill }: { title: string; fill: string }) {
424
+ const STRIP_INSET_PX = 4;
425
+ const STRIP_BOTTOM_PX = 2;
426
+ const STRIP_TRACK_OPACITY = 0.3;
427
+
428
+ function GanttBarLabel({
429
+ title,
430
+ fill,
431
+ state,
432
+ surface,
433
+ dark,
434
+ }: {
435
+ title: string;
436
+ fill: string;
437
+ state: EventState;
438
+ surface: string | undefined;
439
+ dark: boolean;
440
+ }) {
415
441
  const { knobProps } = useResolvedKnobs();
416
- const ink = useReadableTextOn(fill);
442
+ const theme = useTheme() as unknown as EventThemeValues;
443
+ const solid = dark || state === "ghost" ? null : eventSolid(theme, fill, state);
444
+ const ink =
445
+ solid?.ink ??
446
+ eventLabelInk(
447
+ theme,
448
+ fill,
449
+ [eventPaint(theme, fill, state, { dark, surface })],
450
+ dark,
451
+ state === "ghost" ? "secondary" : "primary",
452
+ );
417
453
  return (
418
454
  <TamaguiText
419
- color={ink ?? "$color-1"}
455
+ color={ink}
420
456
  {...knobProps.label}
421
457
  numberOfLines={1}
422
458
  paddingHorizontal={knobProps.control.paddingHorizontal}
423
459
  pointerEvents="none"
424
460
  zIndex={1}
425
461
  aria-hidden
426
- >
427
- {`${title}\u200b`}
428
- </TamaguiText>
462
+ {...{
463
+ "data-gantt-bar-ink": ink,
464
+ "data-gantt-ghost-label": state === "ghost" ? "true" : undefined,
465
+ }}
466
+ >{`${title}\u200b`}</TamaguiText>
429
467
  );
430
468
  }
431
469
 
432
470
  function GanttIntervalFill({
433
471
  fill,
472
+ surface,
434
473
  openStart,
435
474
  openEnd,
436
475
  width,
437
476
  rtl,
438
- ghost,
477
+ state,
478
+ dark,
479
+ progress,
480
+ lead,
439
481
  }: {
440
482
  fill: string;
483
+ surface: string | undefined;
441
484
  openStart: boolean;
442
485
  openEnd: boolean;
443
486
  width: number;
444
487
  rtl: boolean;
445
- ghost: boolean;
488
+ state: EventState;
489
+ dark: boolean;
490
+ progress: number | null;
491
+ lead: boolean;
446
492
  }) {
447
493
  const { knobProps } = useResolvedKnobs();
448
494
  const theme = useTheme();
495
+ const values = theme as unknown as EventThemeValues;
449
496
  const fillKey = fill.startsWith("$") ? fill.slice(1) : fill;
450
- const color = theme[fillKey]?.val ?? getTokenValue(fillKey as any, "color") ?? fill;
451
- const clear = normalizeColor(String(color), 0) ?? "transparent";
497
+ const color = String(theme[fillKey]?.val ?? getTokenValue(fillKey as any, "color") ?? fill);
498
+ const solid = dark || state === "ghost" ? null : eventSolid(values, fill, state);
499
+ const paint = solid?.paint ?? eventPaint(values, fill, state, { dark, surface });
500
+ const body = paint ?? color;
501
+ const strip = solid ? solid.ink : paint ? eventStripPaint(values, fill, { dark, surface }) : null;
502
+ const leading = lead && !solid;
503
+ const clear = normalizeColor(body, 0) ?? "transparent";
452
504
  const fadeWidth = Math.min(Number(knobProps.control.height), width / 2);
453
505
  const leftOpen = rtl ? openEnd : openStart;
454
506
  const rightOpen = rtl ? openStart : openEnd;
507
+ const stripStart = (leading ? EVENT_BAR_PX : 0) + STRIP_INSET_PX;
508
+ const stripWidth =
509
+ progress != null ? (Math.max(0, width - stripStart - STRIP_INSET_PX) * progress) / 100 : 0;
455
510
  return (
456
511
  <YStack
457
512
  position="absolute"
@@ -460,9 +515,10 @@ function GanttIntervalFill({
460
515
  left={0}
461
516
  right={0}
462
517
  pointerEvents="none"
463
- opacity={ghost ? 0.25 : 1}
464
518
  overflow="hidden"
465
519
  {...knobProps.borderRadius}
520
+ borderWidth={0}
521
+ {...{ "data-gantt-bar-state": state, "data-gantt-bar-paint": paint ?? undefined }}
466
522
  >
467
523
  <YStack
468
524
  position="absolute"
@@ -470,7 +526,8 @@ function GanttIntervalFill({
470
526
  bottom={0}
471
527
  left={leftOpen ? fadeWidth : 0}
472
528
  right={rightOpen ? fadeWidth : 0}
473
- backgroundColor={fill as any}
529
+ backgroundColor={body as any}
530
+ {...{ "data-gantt-bar-fill": fill }}
474
531
  />
475
532
  {(["start", "end"] as const).map((edge) => {
476
533
  if (edge === "start" ? !openStart : !openEnd) return null;
@@ -483,13 +540,49 @@ function GanttIntervalFill({
483
540
  bottom={0}
484
541
  {...(left ? { left: 0 } : { right: 0 })}
485
542
  width={fadeWidth}
486
- colors={left ? [clear, String(color)] : [String(color), clear]}
543
+ colors={left ? [clear, body] : [body, clear]}
487
544
  start={[0, 0]}
488
545
  end={[1, 0]}
489
546
  {...{ "data-gantt-open-fade": edge, [`data-gantt-open-${edge}`]: "true" }}
490
547
  />
491
548
  );
492
549
  })}
550
+ {solid && progress != null && (
551
+ <YStack
552
+ position="absolute"
553
+ bottom={STRIP_BOTTOM_PX}
554
+ height={EVENT_BAR_PX}
555
+ {...(rtl ? { right: stripStart } : { left: stripStart })}
556
+ width={Math.max(0, width - stripStart - STRIP_INSET_PX)}
557
+ borderRadius={EVENT_BAR_PX / 2}
558
+ backgroundColor={solid.ink as any}
559
+ opacity={STRIP_TRACK_OPACITY}
560
+ {...{ "data-gantt-progress-track": solid.ink }}
561
+ />
562
+ )}
563
+ {stripWidth > 0 && (
564
+ <YStack
565
+ position="absolute"
566
+ bottom={STRIP_BOTTOM_PX}
567
+ height={EVENT_BAR_PX}
568
+ {...(rtl ? { right: stripStart } : { left: stripStart })}
569
+ width={stripWidth}
570
+ borderRadius={EVENT_BAR_PX / 2}
571
+ backgroundColor={(strip ?? color) as any}
572
+ {...{ "data-gantt-progress": String(progress), "data-gantt-progress-paint": strip }}
573
+ />
574
+ )}
575
+ {leading && (
576
+ <YStack
577
+ position="absolute"
578
+ top={0}
579
+ bottom={0}
580
+ {...(rtl ? { right: 0 } : { left: 0 })}
581
+ width={EVENT_BAR_PX}
582
+ backgroundColor={color as any}
583
+ {...{ "data-gantt-bar-lead": "true" }}
584
+ />
585
+ )}
493
586
  </YStack>
494
587
  );
495
588
  }
@@ -604,6 +697,10 @@ export function GanttView({
604
697
  ...stackProps
605
698
  }: GanttViewProps) {
606
699
  const identity = useChartPalette().single;
700
+ const canvasTheme = useTheme() as unknown as EventThemeValues;
701
+ const canvasBackground = canvasTheme.background?.val;
702
+ const canvasGround = typeof canvasBackground === "string" ? canvasBackground : undefined;
703
+ const dark = useEventDark();
607
704
  const { t } = useTranslation();
608
705
  const { knobProps } = useResolvedKnobs();
609
706
  const [zoom, setZoom] = useState<GanttZoom>(initialZoom);
@@ -980,6 +1077,8 @@ export function GanttView({
980
1077
  if (session.liftTimer) clearTimeout(session.liftTimer);
981
1078
  if (!session.dragging) {
982
1079
  // Treat as a tap — responders steal onPress when drag is enabled.
1080
+ setFocusedBarId(session.ref.key);
1081
+ setBarKeyboardRing(false);
983
1082
  onItemPress?.(session.task);
984
1083
  return;
985
1084
  }
@@ -1359,12 +1458,27 @@ export function GanttView({
1359
1458
  // that claimed 40% of forever would be inventing the denominator.
1360
1459
  const progress = bounded && !ghost ? clampProgress(span.progress ?? task.progress) : null;
1361
1460
  const showLabel = !geom.eternal && liveWidth >= 44;
1461
+ const labelOutside = !showLabel && !geom.eternal && !ghost && resolveSpans(task).length === 1;
1362
1462
  const isBarFocused = focusedBarId === barKey;
1363
1463
  const showHandles = hoveredId === task.id || sessionLive || isBarFocused;
1464
+ const barState: EventState = ghost
1465
+ ? "ghost"
1466
+ : showHandles || geom.eternal
1467
+ ? "selected"
1468
+ : "rest";
1364
1469
  // Edge handles map physical sides to logical edges (mirrored under RTL).
1365
1470
  const handleWidth = bounded ? (geom.width >= 24 ? 8 : geom.width >= 12 ? 4 : 0) : 0;
1366
1471
  const physicalLeftEdge: GanttResizeEdge = rtl ? "end" : "start";
1367
1472
  const physicalRightEdge: GanttResizeEdge = rtl ? "start" : "end";
1473
+ const logicalLeft = geom.x + liveTransformX * dirSign;
1474
+ const gripShift = (edge: GanttResizeEdge) => {
1475
+ const at = edge === "start" ? logicalLeft : logicalLeft + liveWidth;
1476
+ const inside = Math.max(
1477
+ visibleWindow.start + EVENT_GRIP_DOT_PX / 2,
1478
+ Math.min(at, visibleWindow.end - EVENT_GRIP_DOT_PX / 2),
1479
+ );
1480
+ return (inside - at) * dirSign;
1481
+ };
1368
1482
  // An open END is physically on the right in LTR and on the left in RTL —
1369
1483
  // the chevron follows the mirror, and so does which glyph it is.
1370
1484
  const squareStart = rtl
@@ -1408,9 +1522,8 @@ export function GanttView({
1408
1522
  backgroundColor="transparent"
1409
1523
  {...(ghost
1410
1524
  ? { borderStyle: "dashed", borderWidth: hairlineWidth, borderColor: fill as any }
1411
- : {})}
1412
- // A rail reads as chrome, not as a duration somebody set.
1413
- opacity={`${sessionLive ? 0.85 : geom.eternal ? 0.55 : 1} hover:${sessionLive ? 0.85 : geom.eternal ? 0.7 : 0.9} press:0.8`}
1525
+ : { borderWidth: 0 })}
1526
+ opacity={`${sessionLive ? 0.85 : 1} press:0.8`}
1414
1527
  cursor={bounded && webDragEnabled ? "grab" : onItemPress ? "pointer" : undefined}
1415
1528
  justifyContent="center"
1416
1529
  // LC-25: committed/reverted geometry jumps tween on web; the live
@@ -1477,39 +1590,55 @@ export function GanttView({
1477
1590
  : (e) => {
1478
1591
  (e as any)?.stopPropagation?.();
1479
1592
  if (suppressClickRef.current) return;
1593
+ setFocusedBarId(barKey);
1480
1594
  onItemPress?.(task);
1481
1595
  }
1482
1596
  }
1483
1597
  >
1484
1598
  <GanttIntervalFill
1485
1599
  fill={fill}
1600
+ surface={canvasGround}
1486
1601
  openStart={geom.openStart}
1487
1602
  openEnd={geom.openEnd}
1488
1603
  width={liveWidth}
1489
1604
  rtl={rtl}
1490
- ghost={ghost}
1605
+ state={barState}
1606
+ dark={dark}
1607
+ progress={progress}
1608
+ lead={!ghost && !geom.openStart}
1491
1609
  />
1492
- {progress != null && progress > 0 && (
1610
+ {showLabel && (
1611
+ <GanttBarLabel
1612
+ title={barTitle}
1613
+ fill={fill}
1614
+ state={barState}
1615
+ surface={canvasGround}
1616
+ dark={dark}
1617
+ />
1618
+ )}
1619
+
1620
+ {labelOutside && (
1493
1621
  <YStack
1494
1622
  position="absolute"
1495
1623
  top={0}
1496
1624
  bottom={0}
1497
- {...(rtl ? { right: 0 } : { left: 0 })}
1498
- width={`${progress}%`}
1499
- backgroundColor="color-12"
1500
- opacity={0.22}
1625
+ {...(rtl ? { right: liveWidth } : { left: liveWidth })}
1626
+ width={Math.max(0, chartWidth - geom.x - liveWidth)}
1627
+ justifyContent="center"
1501
1628
  pointerEvents="none"
1502
- data-gantt-progress={String(progress)}
1503
- />
1504
- )}
1505
- {showLabel &&
1506
- (ghost ? (
1507
- <Text {...knobProps.label} color="$color" numberOfLines={1} pointerEvents="none">
1629
+ {...{ "data-gantt-bar-outside-label": "true" }}
1630
+ >
1631
+ <TamaguiText
1632
+ {...knobProps.label}
1633
+ color="$color"
1634
+ numberOfLines={1}
1635
+ paddingHorizontal={knobProps.control.paddingHorizontal}
1636
+ aria-hidden
1637
+ >
1508
1638
  {barTitle}
1509
- </Text>
1510
- ) : (
1511
- <GanttBarLabel title={barTitle} fill={fill} />
1512
- ))}
1639
+ </TamaguiText>
1640
+ </YStack>
1641
+ )}
1513
1642
 
1514
1643
  {/* Live date label while dragging (honest preview of the commit). */}
1515
1644
  {previewSpan && (
@@ -1542,11 +1671,17 @@ export function GanttView({
1542
1671
  bottom={0}
1543
1672
  width={handleWidth}
1544
1673
  cursor="ew-resize"
1545
- backgroundColor={`${showHandles ? "color-12" : "transparent"}`}
1546
- opacity={showHandles ? 0.28 : 0}
1547
- data-gantt-resize-handle={physicalLeftEdge}
1548
1674
  onPointerDown={(e: any) => handleResizePointerDown(task, ref, physicalLeftEdge, e)}
1549
- />
1675
+ {...{ "data-gantt-resize-handle": physicalLeftEdge }}
1676
+ >
1677
+ <GanttGripDot
1678
+ left={gripShift(physicalLeftEdge) - EVENT_GRIP_DOT_PX / 2}
1679
+ top={(physicalLeftEdge === "start" ? height : 0) - EVENT_GRIP_DOT_PX / 2}
1680
+ color={fill}
1681
+ shown={showHandles}
1682
+ edge={physicalLeftEdge}
1683
+ />
1684
+ </YStack>
1550
1685
  <YStack
1551
1686
  position="absolute"
1552
1687
  right={0}
@@ -1554,11 +1689,17 @@ export function GanttView({
1554
1689
  bottom={0}
1555
1690
  width={handleWidth}
1556
1691
  cursor="ew-resize"
1557
- backgroundColor={`${showHandles ? "color-12" : "transparent"}`}
1558
- opacity={showHandles ? 0.28 : 0}
1559
- data-gantt-resize-handle={physicalRightEdge}
1560
1692
  onPointerDown={(e: any) => handleResizePointerDown(task, ref, physicalRightEdge, e)}
1561
- />
1693
+ {...{ "data-gantt-resize-handle": physicalRightEdge }}
1694
+ >
1695
+ <GanttGripDot
1696
+ left={handleWidth + gripShift(physicalRightEdge) - EVENT_GRIP_DOT_PX / 2}
1697
+ top={(physicalRightEdge === "start" ? height : 0) - EVENT_GRIP_DOT_PX / 2}
1698
+ color={fill}
1699
+ shown={showHandles}
1700
+ edge={physicalRightEdge}
1701
+ />
1702
+ </YStack>
1562
1703
  </>
1563
1704
  )}
1564
1705
 
@@ -1600,6 +1741,15 @@ export function GanttView({
1600
1741
  snapUnit={snapUnit}
1601
1742
  firstDayOfWeek={firstDayOfWeek}
1602
1743
  label={`${barTitle}: ${edge === "start" ? t("Start") : t("End")}`}
1744
+ barWidth={liveWidth}
1745
+ barTop={barInset + (barHeight - height) / 2}
1746
+ barBottom={barInset + (barHeight + height) / 2}
1747
+ color={fill}
1748
+ shown={showHandles || activeInterval}
1749
+ gripOf={barKey}
1750
+ onHoverChange={(hovered) =>
1751
+ setHoveredId((id) => (hovered ? task.id : id === task.id ? null : id))
1752
+ }
1603
1753
  valueText={
1604
1754
  span[edge]
1605
1755
  ? formatAbsoluteDate(span[edge]!)
@@ -1935,6 +2085,22 @@ export function GanttView({
1935
2085
  <YStack width={chartWidth} position="relative" {...{ "data-gantt-chart": "true" }}>
1936
2086
  {/* Rows + grid + today line */}
1937
2087
  <YStack position="relative" {...{ "data-gantt-body": "true" }}>
2088
+ {tasks.map((task, index) =>
2089
+ hoveredId === task.id ||
2090
+ resolveSpans(task).some((ref) => ref.key === focusedBarId) ? (
2091
+ <YStack
2092
+ key={`row-band-${task.id}`}
2093
+ position="absolute"
2094
+ left={0}
2095
+ right={0}
2096
+ top={index * rowHeight}
2097
+ height={rowHeight}
2098
+ backgroundColor={componentColors.interactive.background}
2099
+ pointerEvents="none"
2100
+ {...{ "data-gantt-row-band": task.id }}
2101
+ />
2102
+ ) : null,
2103
+ )}
1938
2104
  {weekends.map((col) => (
1939
2105
  <YStack
1940
2106
  key={`body-we-${col.key}`}
@@ -1976,11 +2142,24 @@ export function GanttView({
1976
2142
  />
1977
2143
  ))}
1978
2144
 
2145
+ {/* Today line (under the bars, so it never cuts a label) */}
2146
+ {todayX !== null && (
2147
+ <YStack
2148
+ position="absolute"
2149
+ {...canvasPos(todayX - 1)}
2150
+ top={0}
2151
+ bottom={0}
2152
+ width={2}
2153
+ backgroundColor={componentColors.indicator.mark}
2154
+ opacity={0.9}
2155
+ pointerEvents="none"
2156
+ {...{ "data-gantt-today": "true" }}
2157
+ />
2158
+ )}
2159
+
1979
2160
  {/* Task rows */}
1980
2161
  {tasks.map((task, index) => {
1981
2162
  const refs = resolveSpans(task);
1982
- const selected = refs.some((ref) => ref.key === focusedBarId);
1983
- const hovered = hoveredId === task.id;
1984
2163
  const last = index === tasks.length - 1;
1985
2164
  return (
1986
2165
  <XStack
@@ -1989,11 +2168,7 @@ export function GanttView({
1989
2168
  position="relative"
1990
2169
  {...(last ? null : hairline.bottom)}
1991
2170
  borderColor={minorGridColor}
1992
- backgroundColor={
1993
- selected || hovered
1994
- ? componentColors.interactive.background
1995
- : "transparent"
1996
- }
2171
+ backgroundColor="transparent"
1997
2172
  // Tamagui forwards onHoverIn/onHoverOut at runtime; the
1998
2173
  // RN-flavored View prop type omits them (house Record cast).
1999
2174
  {...({
@@ -2022,22 +2197,6 @@ export function GanttView({
2022
2197
  data-gantt-marker={"true"}
2023
2198
  />
2024
2199
  )}
2025
-
2026
- {/* Today line (above bars, non-interactive) */}
2027
- {todayX !== null && (
2028
- <YStack
2029
- position="absolute"
2030
- {...canvasPos(todayX - 1)}
2031
- top={0}
2032
- bottom={0}
2033
- width={2}
2034
- backgroundColor={componentColors.indicator.mark}
2035
- opacity={0.9}
2036
- pointerEvents="none"
2037
- zIndex={2}
2038
- {...{ "data-gantt-today": "true" }}
2039
- />
2040
- )}
2041
2200
  </YStack>
2042
2201
  </YStack>
2043
2202
  </CanvasScroller>
@@ -21,6 +21,7 @@ vi.mock("@multiplatform.one/theme", () => ({
21
21
  knobProps: { controlIcon: { width: 16, height: 16 }, containerRadius: {}, inputSurface: {} },
22
22
  }),
23
23
  }));
24
+ vi.mock("./eventTint", () => ({ EVENT_GRIP_DOT_PX: 10 }));
24
25
  const { GanttDateGrip } = await import("./GanttDateGrip");
25
26
  afterEach(cleanup);
26
27
  const day = (n: number) => new Date(2026, 2, n);
@@ -42,7 +43,14 @@ function setup(overrides: Partial<ComponentProps<typeof GanttDateGrip>> = {}) {
42
43
  snapUnit="day"
43
44
  firstDayOfWeek={0}
44
45
  label="Policy: End"
46
+ barWidth={600}
47
+ barTop={8}
48
+ barBottom={40}
49
+ color="$color-9"
45
50
  valueText="No end"
51
+ shown
52
+ gripOf="policy"
53
+ onHoverChange={vi.fn()}
46
54
  onCommit={onCommit}
47
55
  onPreview={onPreview}
48
56
  {...overrides}
@@ -3,7 +3,6 @@ import { View as NativeView } from "react-native";
3
3
  import { YStack, isWeb } from "tamagui";
4
4
  import {
5
5
  MIN_PRESS_TARGET,
6
- hairlineWidth,
7
6
  keyboardFocusRingProps,
8
7
  useResolvedKnobs,
9
8
  } from "@multiplatform.one/theme";
@@ -14,6 +13,8 @@ import {
14
13
  type GanttRange,
15
14
  type GanttResizeEdge,
16
15
  } from "./ganttMath";
16
+ import { GanttGripDot } from "./GanttGripDot";
17
+ import { EVENT_GRIP_DOT_PX } from "./eventTint";
17
18
  import {
18
19
  editIntervalEdge,
19
20
  intervalEdgeX,
@@ -36,6 +37,13 @@ interface GanttDateGripProps {
36
37
  firstDayOfWeek: 0 | 1;
37
38
  label: string;
38
39
  valueText: string;
40
+ barWidth: number;
41
+ barTop: number;
42
+ barBottom: number;
43
+ color: string;
44
+ shown: boolean;
45
+ gripOf: string;
46
+ onHoverChange: (hovered: boolean) => void;
39
47
  onPreview: (span: GanttOpenSpan | null) => void;
40
48
  onCommit: (span: GanttOpenSpan) => void;
41
49
  }
@@ -73,18 +81,21 @@ export function GanttDateGrip(props: GanttDateGripProps) {
73
81
  rtl,
74
82
  ],
75
83
  );
84
+ const glyphWidth = Number(knobProps.controlIcon.width);
76
85
  const width = Math.min(MIN_PRESS_TARGET, Math.max(0, viewport.end - viewport.start));
86
+ const inner = Math.min(width / 2, Math.max(0, props.barWidth / 2));
77
87
  const logicalLeft = Math.max(
78
88
  viewport.start,
79
- Math.min(edge === "start" ? x - width : x, viewport.end - width),
89
+ Math.min(edge === "start" ? x - (width - inner) : x - inner, viewport.end - width),
80
90
  );
81
91
  const left = rtl ? chartWidth - logicalLeft - width : logicalLeft;
82
-
83
- const glyphWidth = Number(knobProps.controlIcon.width);
84
- const glyphLeft = Math.max(
85
- 0,
86
- Math.min((rtl ? chartWidth - x : x) - left - glyphWidth / 2, width - glyphWidth),
92
+ const dotX = Math.max(
93
+ viewport.start + EVENT_GRIP_DOT_PX / 2,
94
+ Math.min(x, viewport.end - EVENT_GRIP_DOT_PX / 2),
87
95
  );
96
+ const dotLeft = (rtl ? chartWidth - dotX : dotX) - left - EVENT_GRIP_DOT_PX / 2;
97
+ const dotTop = (edge === "start" ? props.barBottom : props.barTop) - EVENT_GRIP_DOT_PX / 2;
98
+ const visible = props.shown || focused;
88
99
 
89
100
  const begin = (startX: number) => {
90
101
  cleanup.current?.();
@@ -202,6 +213,8 @@ export function GanttDateGrip(props: GanttDateGripProps) {
202
213
  },
203
214
  onFocus: () => setFocused(true),
204
215
  onBlur: () => setFocused(false),
216
+ onHoverIn: () => props.onHoverChange(true),
217
+ onHoverOut: () => props.onHoverChange(false),
205
218
  tabIndex: 0,
206
219
  role: "slider",
207
220
  "aria-label": label,
@@ -210,6 +223,7 @@ export function GanttDateGrip(props: GanttDateGripProps) {
210
223
  "aria-valuemin": Math.floor(viewport.start / pxPerDay),
211
224
  "aria-valuemax": Math.ceil(viewport.end / pxPerDay),
212
225
  "data-gantt-date-grip": edge,
226
+ "data-gantt-grip-of": props.gripOf,
213
227
  }
214
228
  : {
215
229
  accessible: true,
@@ -243,22 +257,19 @@ export function GanttDateGrip(props: GanttDateGripProps) {
243
257
  width,
244
258
  height: rowHeight,
245
259
  zIndex: 6,
260
+ ...(isWeb || visible ? null : { pointerEvents: "none" }),
246
261
  alignItems: "center",
247
262
  justifyContent: "center",
248
263
  ...(isWeb ? { touchAction: "none", cursor: "ew-resize" } : {}),
249
264
  } as any
250
265
  }
251
266
  >
252
- <YStack
253
- position="absolute"
254
- left={glyphLeft}
255
- width={knobProps.controlIcon.width}
256
- height={knobProps.controlIcon.height}
257
- {...knobProps.containerRadius}
258
- backgroundColor="background"
259
- borderColor="color-12"
260
- borderWidth={hairlineWidth}
261
- pointerEvents="none"
267
+ <GanttGripDot
268
+ left={dotLeft}
269
+ top={dotTop}
270
+ color={props.color}
271
+ shown={props.shown || focused}
272
+ edge={edge}
262
273
  {...(focused ? keyboardFocusRingProps : {})}
263
274
  />
264
275
  </Surface>
@@ -0,0 +1,36 @@
1
+ import { YStack } from "tamagui";
2
+ import { EVENT_GRIP_DOT_PX } from "./eventTint";
3
+
4
+ export function GanttGripDot({
5
+ left,
6
+ top,
7
+ color,
8
+ shown,
9
+ edge,
10
+ ...ring
11
+ }: {
12
+ left: number;
13
+ top: number;
14
+ color: string;
15
+ shown: boolean;
16
+ edge: string;
17
+ [ring: string]: unknown;
18
+ }) {
19
+ return (
20
+ <YStack
21
+ position="absolute"
22
+ left={left}
23
+ top={top}
24
+ width={EVENT_GRIP_DOT_PX}
25
+ height={EVENT_GRIP_DOT_PX}
26
+ borderRadius={EVENT_GRIP_DOT_PX / 2}
27
+ borderWidth={2}
28
+ borderColor={color as any}
29
+ backgroundColor="background"
30
+ opacity={shown ? 1 : 0}
31
+ pointerEvents="none"
32
+ {...ring}
33
+ {...{ "data-gantt-date-grip-glyph": edge }}
34
+ />
35
+ );
36
+ }