@trackunit/react-map 0.2.42-alpha-06136b80b13.0 → 0.2.43

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/index.cjs.js CHANGED
@@ -823,7 +823,8 @@ const PANEL_SCROLL_INTERNAL_CLASS_NAME = "flex flex-1 min-h-0 flex-col overflow-
823
823
  * "" — element is in DOM (for Floating UI to measure) but hidden via
824
824
  * CSS `visibility: hidden` so the pre-commit translate(0,0)
825
825
  * position is never visible.
826
- * "open" — fades in via CSS opacity transition once placement is committed.
826
+ * "open" — appears instantly once placement is committed (no enter
827
+ * animation — see docs/adr/0027-instant-panel-first-paint.md).
827
828
  * "closing" — fades out during the EXIT_DURATION_MS window before unmount.
828
829
  *
829
830
  * @internal
@@ -972,9 +973,9 @@ const Panel = ({ anchor, placement = DEFAULT_PLACEMENT$1, onDismiss, closeLabel
972
973
  if (effectiveAnchor === null) {
973
974
  return null;
974
975
  }
975
- // data-panel drives the CSS animation state machine (Panel.css):
976
+ // data-panel drives the CSS visibility state machine (Panel.css):
976
977
  // "" — pre-commit: visibility:hidden so translate(0,0) is never seen
977
- // "open" — fade in via opacity transition
978
+ // "open" — instant appearance (no enter animation)
978
979
  // "closing" — fade out before unmount
979
980
  const panelState = isClosing ? "closing" : isCommitted ? "open" : "";
980
981
  return (jsxRuntime.jsxs("div", { className: PANEL_SHELL_CLASS_NAME, "data-panel": panelState, ref: mergedShellRef, style: floatingStyles, ...getFloatingProps(), "aria-label": ariaLabel, children: [jsxRuntime.jsx("div", { className: PANEL_CHROME_CLASS_NAME, style: { maxHeight: `min(${PANEL_MAX_HEIGHT_PX}px, ${PANEL_MAX_HEIGHT_VH}vh)` }, children: jsxRuntime.jsx("div", { className: scrollSlotClassName, "data-testid": "panel-scroll-slot", ref: scrollRef, children: children }) }), onClickDismiss !== undefined ? (jsxRuntime.jsx("div", { className: "absolute right-0 top-0 z-10 -translate-y-1/2 translate-x-1/2 rounded-2xl border border-neutral-300 bg-white shadow-sm", children: jsxRuntime.jsx(PanelIconButton, { "aria-label": closeLabel, "data-testid": "panel-close-button", onClick: onClickDismiss, children: jsxRuntime.jsx(reactComponents.Icon, { ariaHidden: true, className: "text-neutral-700", name: "XMark", size: "small" }) }) })) : null] }));
@@ -2063,6 +2064,10 @@ const computePlacement = (triggerEl, containerEl) => {
2063
2064
  const usePopoverPlacement = (triggerRef, containerRef, options = {}) => {
2064
2065
  const { skip = false } = options;
2065
2066
  const [placement, setPlacement] = react.useState(DEFAULT_PLACEMENT);
2067
+ // Post-paint measurement is sufficient: both callers invoke this hook where
2068
+ // the always-mounted trigger renders, so placement settles with the map —
2069
+ // long before a popover can open. A layout effect would only add pre-paint
2070
+ // measurement work during map load (SAGA-675 review).
2066
2071
  react.useEffect(() => {
2067
2072
  if (skip) {
2068
2073
  return;
package/index.esm.js CHANGED
@@ -822,7 +822,8 @@ const PANEL_SCROLL_INTERNAL_CLASS_NAME = "flex flex-1 min-h-0 flex-col overflow-
822
822
  * "" — element is in DOM (for Floating UI to measure) but hidden via
823
823
  * CSS `visibility: hidden` so the pre-commit translate(0,0)
824
824
  * position is never visible.
825
- * "open" — fades in via CSS opacity transition once placement is committed.
825
+ * "open" — appears instantly once placement is committed (no enter
826
+ * animation — see docs/adr/0027-instant-panel-first-paint.md).
826
827
  * "closing" — fades out during the EXIT_DURATION_MS window before unmount.
827
828
  *
828
829
  * @internal
@@ -971,9 +972,9 @@ const Panel = ({ anchor, placement = DEFAULT_PLACEMENT$1, onDismiss, closeLabel
971
972
  if (effectiveAnchor === null) {
972
973
  return null;
973
974
  }
974
- // data-panel drives the CSS animation state machine (Panel.css):
975
+ // data-panel drives the CSS visibility state machine (Panel.css):
975
976
  // "" — pre-commit: visibility:hidden so translate(0,0) is never seen
976
- // "open" — fade in via opacity transition
977
+ // "open" — instant appearance (no enter animation)
977
978
  // "closing" — fade out before unmount
978
979
  const panelState = isClosing ? "closing" : isCommitted ? "open" : "";
979
980
  return (jsxs("div", { className: PANEL_SHELL_CLASS_NAME, "data-panel": panelState, ref: mergedShellRef, style: floatingStyles, ...getFloatingProps(), "aria-label": ariaLabel, children: [jsx("div", { className: PANEL_CHROME_CLASS_NAME, style: { maxHeight: `min(${PANEL_MAX_HEIGHT_PX}px, ${PANEL_MAX_HEIGHT_VH}vh)` }, children: jsx("div", { className: scrollSlotClassName, "data-testid": "panel-scroll-slot", ref: scrollRef, children: children }) }), onClickDismiss !== undefined ? (jsx("div", { className: "absolute right-0 top-0 z-10 -translate-y-1/2 translate-x-1/2 rounded-2xl border border-neutral-300 bg-white shadow-sm", children: jsx(PanelIconButton, { "aria-label": closeLabel, "data-testid": "panel-close-button", onClick: onClickDismiss, children: jsx(Icon, { ariaHidden: true, className: "text-neutral-700", name: "XMark", size: "small" }) }) })) : null] }));
@@ -2062,6 +2063,10 @@ const computePlacement = (triggerEl, containerEl) => {
2062
2063
  const usePopoverPlacement = (triggerRef, containerRef, options = {}) => {
2063
2064
  const { skip = false } = options;
2064
2065
  const [placement, setPlacement] = useState(DEFAULT_PLACEMENT);
2066
+ // Post-paint measurement is sufficient: both callers invoke this hook where
2067
+ // the always-mounted trigger renders, so placement settles with the map —
2068
+ // long before a popover can open. A layout effect would only add pre-paint
2069
+ // measurement work during map load (SAGA-675 review).
2065
2070
  useEffect(() => {
2066
2071
  if (skip) {
2067
2072
  return;
package/package.json CHANGED
@@ -1,22 +1,22 @@
1
1
  {
2
2
  "name": "@trackunit/react-map",
3
- "version": "0.2.42-alpha-06136b80b13.0",
3
+ "version": "0.2.43",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
7
7
  "node": ">=24.x"
8
8
  },
9
9
  "dependencies": {
10
- "@trackunit/react-components": "2.3.3-alpha-06136b80b13.0",
11
- "@trackunit/css-class-variance-utilities": "1.13.88-alpha-06136b80b13.0",
12
- "@trackunit/react-form-components": "2.3.3-alpha-06136b80b13.0",
13
- "@trackunit/react-core-hooks": "1.19.3-alpha-06136b80b13.0",
14
- "@trackunit/geo-json-utils": "1.14.91-alpha-06136b80b13.0",
15
- "@trackunit/i18n-library-translation": "2.2.3-alpha-06136b80b13.0",
10
+ "@trackunit/react-components": "2.3.3",
11
+ "@trackunit/css-class-variance-utilities": "1.13.88",
12
+ "@trackunit/react-form-components": "2.3.3",
13
+ "@trackunit/react-core-hooks": "1.19.3",
14
+ "@trackunit/geo-json-utils": "1.14.91",
15
+ "@trackunit/i18n-library-translation": "2.2.3",
16
16
  "react-minimal-pie-chart": "^8.4.0",
17
- "@trackunit/react-map-adapter-shared": "0.0.72-alpha-06136b80b13.0",
18
- "@trackunit/react-map-color-utils": "0.0.57-alpha-06136b80b13.0",
19
- "@trackunit/ui-design-tokens": "1.13.87-alpha-06136b80b13.0",
17
+ "@trackunit/react-map-adapter-shared": "0.0.72",
18
+ "@trackunit/react-map-color-utils": "0.0.57",
19
+ "@trackunit/ui-design-tokens": "1.13.87",
20
20
  "@floating-ui/react": "^0.26.25",
21
21
  "es-toolkit": "^1.39.10",
22
22
  "tailwind-merge": "^2.0.0",
@@ -56,7 +56,8 @@ export type PanelProps = Readonly<{
56
56
  * "" — element is in DOM (for Floating UI to measure) but hidden via
57
57
  * CSS `visibility: hidden` so the pre-commit translate(0,0)
58
58
  * position is never visible.
59
- * "open" — fades in via CSS opacity transition once placement is committed.
59
+ * "open" — appears instantly once placement is committed (no enter
60
+ * animation — see docs/adr/0027-instant-panel-first-paint.md).
60
61
  * "closing" — fades out during the EXIT_DURATION_MS window before unmount.
61
62
  *
62
63
  * @internal