@uniformdev/design-system 20.71.2-alpha.10 → 20.71.2-alpha.13

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/esm/index.js CHANGED
@@ -8630,19 +8630,8 @@ var PopoverBtn = css53`
8630
8630
  `;
8631
8631
  var Popover = css53`
8632
8632
  z-index: var(--z-menu);
8633
-
8634
- /**
8635
- * Hide the popover when its anchor (trigger) has been scrolled out of view by a
8636
- * clipping ancestor. Without this, the portaled popup keeps tracking the (now
8637
- * hidden) trigger and Base UI's collision avoidance shifts it back into view
8638
- * each scroll frame, producing a flashing/jumping effect (see UNI-9326).
8639
- *
8640
- * 'display: none' is used (rather than 'visibility: hidden') so the
8641
- * positioner is removed from layout while the anchor is hidden; otherwise the
8642
- * still-laid-out positioner causes scroll/layout shift as Floating UI keeps
8643
- * repositioning it during scroll. This is also the pattern Base UI's docs
8644
- * recommend for data-anchor-hidden.
8645
- */
8633
+ `;
8634
+ var PopoverHideWhenAnchorHidden = css53`
8646
8635
  &[data-anchor-hidden] {
8647
8636
  display: none;
8648
8637
  }
@@ -8652,6 +8641,7 @@ var PopoverDefaulterTriggerBtn = css53`
8652
8641
  background: none;
8653
8642
  padding: var(--spacing-2xs);
8654
8643
  border-radius: var(--rounded-full);
8644
+ flex-shrink: 0;
8655
8645
 
8656
8646
  &:hover {
8657
8647
  background-color: rgba(0, 0, 0, 0.05);
@@ -12453,14 +12443,32 @@ var Popover2 = ({
12453
12443
  [open, setOpen, hide, show]
12454
12444
  );
12455
12445
  const [inlineContainer, setInlineContainer] = useState20(null);
12446
+ const [triggerElement, setTriggerElement] = useState20(null);
12456
12447
  useEffect16(() => {
12457
12448
  onInit == null ? void 0 : onInit({ store: shimStore });
12458
12449
  }, [shimStore]);
12459
12450
  const portalContainer = portal ? modalContainer != null ? modalContainer : void 0 : inlineContainer;
12451
+ const isInModal = Boolean(portal && modalContainer);
12452
+ const positionMethod = isInModal ? "fixed" : "absolute";
12453
+ useEffect16(() => {
12454
+ if (!open || !isInModal || !triggerElement || typeof IntersectionObserver === "undefined") {
12455
+ return;
12456
+ }
12457
+ const observer = new IntersectionObserver((entries) => {
12458
+ for (const entry of entries) {
12459
+ if (!entry.isIntersecting) {
12460
+ hide();
12461
+ }
12462
+ }
12463
+ });
12464
+ observer.observe(triggerElement);
12465
+ return () => observer.disconnect();
12466
+ }, [open, isInModal, triggerElement, hide]);
12460
12467
  return /* @__PURE__ */ jsx102(PopoverComponentContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs68(BaseUIPopover2.Root, { open, onOpenChange: handleOpenChange, children: [
12461
12468
  /* @__PURE__ */ jsx102(
12462
12469
  BaseUIPopover2.Trigger,
12463
12470
  {
12471
+ ref: setTriggerElement,
12464
12472
  css: [PopoverBtn, trigger2 ? void 0 : PopoverDefaulterTriggerBtn],
12465
12473
  title: buttonText,
12466
12474
  "data-testid": testId,
@@ -12471,18 +12479,28 @@ var Popover2 = ({
12471
12479
  ] })
12472
12480
  }
12473
12481
  ),
12474
- /* @__PURE__ */ jsx102(BaseUIPopover2.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx102(BaseUIPopover2.Positioner, { side, align: alignment, sideOffset: gutter, css: Popover, children: /* @__PURE__ */ jsx102(
12475
- BaseUIPopover2.Popup,
12482
+ /* @__PURE__ */ jsx102(BaseUIPopover2.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx102(
12483
+ BaseUIPopover2.Positioner,
12476
12484
  {
12477
- ...id !== void 0 && { id },
12478
- "aria-label": ariaLabel,
12479
- role: "dialog",
12480
- className,
12481
- style,
12482
- tabIndex,
12483
- children: /* @__PURE__ */ jsx102(PopoverBody2, { variant, maxWidth, children })
12485
+ side,
12486
+ align: alignment,
12487
+ sideOffset: gutter,
12488
+ positionMethod,
12489
+ css: [Popover, isInModal ? void 0 : PopoverHideWhenAnchorHidden],
12490
+ children: /* @__PURE__ */ jsx102(
12491
+ BaseUIPopover2.Popup,
12492
+ {
12493
+ ...id !== void 0 && { id },
12494
+ "aria-label": ariaLabel,
12495
+ role: "dialog",
12496
+ className,
12497
+ style,
12498
+ tabIndex,
12499
+ children: /* @__PURE__ */ jsx102(PopoverBody2, { variant, maxWidth, children })
12500
+ }
12501
+ )
12484
12502
  }
12485
- ) }) }),
12503
+ ) }),
12486
12504
  !portal && /* @__PURE__ */ jsx102("span", { ref: setInlineContainer })
12487
12505
  ] }) });
12488
12506
  };
@@ -13449,6 +13467,9 @@ var ObjectGridItemHeading = css87`
13449
13467
  max-width: 100%;
13450
13468
  font-size: var(--fs-sm);
13451
13469
  `;
13470
+ var ObjectGridItemHeadingSlot = css87`
13471
+ flex-shrink: 0;
13472
+ `;
13452
13473
  var PopoverContent = css87`
13453
13474
  min-width: 50px;
13454
13475
  `;
@@ -13485,9 +13506,27 @@ var ObjectGridItemHeading2 = ({
13485
13506
  };
13486
13507
  }, []);
13487
13508
  return /* @__PURE__ */ jsxs79(HorizontalRhythm, { align: "center", gap: "xs", css: { minWidth: 0 }, children: [
13488
- beforeHeadingSlot ? /* @__PURE__ */ jsx114(HorizontalRhythm, { gap: "xs", align: "center", onClick: onStopPropagation, children: beforeHeadingSlot }) : null,
13509
+ beforeHeadingSlot ? /* @__PURE__ */ jsx114(
13510
+ HorizontalRhythm,
13511
+ {
13512
+ gap: "xs",
13513
+ align: "center",
13514
+ css: ObjectGridItemHeadingSlot,
13515
+ onClick: onStopPropagation,
13516
+ children: beforeHeadingSlot
13517
+ }
13518
+ ) : null,
13489
13519
  /* @__PURE__ */ jsx114(Tooltip, { title: hasTruncation && tooltip ? tooltip : "", children: /* @__PURE__ */ jsx114("div", { role: "heading", css: ObjectGridItemHeading, ref: headingRef, ...props, children: heading }) }),
13490
- afterHeadingSlot ? /* @__PURE__ */ jsx114(HorizontalRhythm, { gap: "xs", align: "center", onClick: onStopPropagation, children: afterHeadingSlot }) : null
13520
+ afterHeadingSlot ? /* @__PURE__ */ jsx114(
13521
+ HorizontalRhythm,
13522
+ {
13523
+ gap: "xs",
13524
+ align: "center",
13525
+ css: ObjectGridItemHeadingSlot,
13526
+ onClick: onStopPropagation,
13527
+ children: afterHeadingSlot
13528
+ }
13529
+ ) : null
13491
13530
  ] });
13492
13531
  };
13493
13532
 
package/dist/index.js CHANGED
@@ -10513,19 +10513,8 @@ var PopoverBtn = import_react81.css`
10513
10513
  `;
10514
10514
  var Popover = import_react81.css`
10515
10515
  z-index: var(--z-menu);
10516
-
10517
- /**
10518
- * Hide the popover when its anchor (trigger) has been scrolled out of view by a
10519
- * clipping ancestor. Without this, the portaled popup keeps tracking the (now
10520
- * hidden) trigger and Base UI's collision avoidance shifts it back into view
10521
- * each scroll frame, producing a flashing/jumping effect (see UNI-9326).
10522
- *
10523
- * 'display: none' is used (rather than 'visibility: hidden') so the
10524
- * positioner is removed from layout while the anchor is hidden; otherwise the
10525
- * still-laid-out positioner causes scroll/layout shift as Floating UI keeps
10526
- * repositioning it during scroll. This is also the pattern Base UI's docs
10527
- * recommend for data-anchor-hidden.
10528
- */
10516
+ `;
10517
+ var PopoverHideWhenAnchorHidden = import_react81.css`
10529
10518
  &[data-anchor-hidden] {
10530
10519
  display: none;
10531
10520
  }
@@ -10535,6 +10524,7 @@ var PopoverDefaulterTriggerBtn = import_react81.css`
10535
10524
  background: none;
10536
10525
  padding: var(--spacing-2xs);
10537
10526
  border-radius: var(--rounded-full);
10527
+ flex-shrink: 0;
10538
10528
 
10539
10529
  &:hover {
10540
10530
  background-color: rgba(0, 0, 0, 0.05);
@@ -14398,14 +14388,32 @@ var Popover2 = ({
14398
14388
  [open, setOpen, hide, show]
14399
14389
  );
14400
14390
  const [inlineContainer, setInlineContainer] = (0, import_react121.useState)(null);
14391
+ const [triggerElement, setTriggerElement] = (0, import_react121.useState)(null);
14401
14392
  (0, import_react121.useEffect)(() => {
14402
14393
  onInit == null ? void 0 : onInit({ store: shimStore });
14403
14394
  }, [shimStore]);
14404
14395
  const portalContainer = portal ? modalContainer != null ? modalContainer : void 0 : inlineContainer;
14396
+ const isInModal = Boolean(portal && modalContainer);
14397
+ const positionMethod = isInModal ? "fixed" : "absolute";
14398
+ (0, import_react121.useEffect)(() => {
14399
+ if (!open || !isInModal || !triggerElement || typeof IntersectionObserver === "undefined") {
14400
+ return;
14401
+ }
14402
+ const observer = new IntersectionObserver((entries) => {
14403
+ for (const entry of entries) {
14404
+ if (!entry.isIntersecting) {
14405
+ hide();
14406
+ }
14407
+ }
14408
+ });
14409
+ observer.observe(triggerElement);
14410
+ return () => observer.disconnect();
14411
+ }, [open, isInModal, triggerElement, hide]);
14405
14412
  return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(PopoverComponentContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(import_popover2.Popover.Root, { open, onOpenChange: handleOpenChange, children: [
14406
14413
  /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
14407
14414
  import_popover2.Popover.Trigger,
14408
14415
  {
14416
+ ref: setTriggerElement,
14409
14417
  css: [PopoverBtn, trigger2 ? void 0 : PopoverDefaulterTriggerBtn],
14410
14418
  title: buttonText,
14411
14419
  "data-testid": testId,
@@ -14416,18 +14424,28 @@ var Popover2 = ({
14416
14424
  ] })
14417
14425
  }
14418
14426
  ),
14419
- /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_popover2.Popover.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_popover2.Popover.Positioner, { side, align: alignment, sideOffset: gutter, css: Popover, children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
14420
- import_popover2.Popover.Popup,
14427
+ /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_popover2.Popover.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
14428
+ import_popover2.Popover.Positioner,
14421
14429
  {
14422
- ...id !== void 0 && { id },
14423
- "aria-label": ariaLabel,
14424
- role: "dialog",
14425
- className,
14426
- style,
14427
- tabIndex,
14428
- children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(PopoverBody2, { variant, maxWidth, children })
14430
+ side,
14431
+ align: alignment,
14432
+ sideOffset: gutter,
14433
+ positionMethod,
14434
+ css: [Popover, isInModal ? void 0 : PopoverHideWhenAnchorHidden],
14435
+ children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
14436
+ import_popover2.Popover.Popup,
14437
+ {
14438
+ ...id !== void 0 && { id },
14439
+ "aria-label": ariaLabel,
14440
+ role: "dialog",
14441
+ className,
14442
+ style,
14443
+ tabIndex,
14444
+ children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(PopoverBody2, { variant, maxWidth, children })
14445
+ }
14446
+ )
14429
14447
  }
14430
- ) }) }),
14448
+ ) }),
14431
14449
  !portal && /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("span", { ref: setInlineContainer })
14432
14450
  ] }) });
14433
14451
  };
@@ -15423,6 +15441,9 @@ var ObjectGridItemHeading = import_react135.css`
15423
15441
  max-width: 100%;
15424
15442
  font-size: var(--fs-sm);
15425
15443
  `;
15444
+ var ObjectGridItemHeadingSlot = import_react135.css`
15445
+ flex-shrink: 0;
15446
+ `;
15426
15447
  var PopoverContent = import_react135.css`
15427
15448
  min-width: 50px;
15428
15449
  `;
@@ -15459,9 +15480,27 @@ var ObjectGridItemHeading2 = ({
15459
15480
  };
15460
15481
  }, []);
15461
15482
  return /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)(HorizontalRhythm, { align: "center", gap: "xs", css: { minWidth: 0 }, children: [
15462
- beforeHeadingSlot ? /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(HorizontalRhythm, { gap: "xs", align: "center", onClick: onStopPropagation, children: beforeHeadingSlot }) : null,
15483
+ beforeHeadingSlot ? /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
15484
+ HorizontalRhythm,
15485
+ {
15486
+ gap: "xs",
15487
+ align: "center",
15488
+ css: ObjectGridItemHeadingSlot,
15489
+ onClick: onStopPropagation,
15490
+ children: beforeHeadingSlot
15491
+ }
15492
+ ) : null,
15463
15493
  /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(Tooltip, { title: hasTruncation && tooltip ? tooltip : "", children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)("div", { role: "heading", css: ObjectGridItemHeading, ref: headingRef, ...props, children: heading }) }),
15464
- afterHeadingSlot ? /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(HorizontalRhythm, { gap: "xs", align: "center", onClick: onStopPropagation, children: afterHeadingSlot }) : null
15494
+ afterHeadingSlot ? /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
15495
+ HorizontalRhythm,
15496
+ {
15497
+ gap: "xs",
15498
+ align: "center",
15499
+ css: ObjectGridItemHeadingSlot,
15500
+ onClick: onStopPropagation,
15501
+ children: afterHeadingSlot
15502
+ }
15503
+ ) : null
15465
15504
  ] });
15466
15505
  };
15467
15506
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/design-system",
3
- "version": "20.71.2-alpha.10+f05c79f825",
3
+ "version": "20.71.2-alpha.13+1445ced748",
4
4
  "description": "Uniform design system components",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "exports": {
@@ -34,8 +34,8 @@
34
34
  "@storybook/react-vite": "10.4.6",
35
35
  "@types/react": "19.2.17",
36
36
  "@types/react-dom": "19.2.3",
37
- "@uniformdev/canvas": "^20.71.2-alpha.10+f05c79f825",
38
- "@uniformdev/richtext": "^20.71.2-alpha.10+f05c79f825",
37
+ "@uniformdev/canvas": "^20.71.2-alpha.13+1445ced748",
38
+ "@uniformdev/richtext": "^20.71.2-alpha.13+1445ced748",
39
39
  "autoprefixer": "10.5.0",
40
40
  "hygen": "6.2.11",
41
41
  "jsdom": "29.1.1",
@@ -82,5 +82,5 @@
82
82
  "publishConfig": {
83
83
  "access": "public"
84
84
  },
85
- "gitHead": "f05c79f825aea4df577b9ac100ff186a5a582a37"
85
+ "gitHead": "1445ced748266b10644d34f1addf52bbab2ef4bb"
86
86
  }