@trackunit/react-map 0.2.46 → 0.2.48-alpha-90b6c9b97dd.0

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
@@ -700,13 +700,12 @@ const SHAPE_STYLE_DEFAULTS = {
700
700
  const PANEL_ICON_BUTTON_CLASS_NAME = tailwindMerge.twMerge("inline-flex h-7 w-7 shrink-0 cursor-pointer items-center justify-center rounded-md border-0 bg-transparent p-1.5 text-neutral-600", "hover:bg-black/5 hover:text-neutral-700", "active:bg-black/10 active:text-neutral-800", "focus-visible:bg-black/10 focus-visible:text-neutral-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-1", "disabled:cursor-not-allowed disabled:bg-transparent disabled:text-neutral-400");
701
701
  /**
702
702
  * Lightweight ghost icon button for map panel chrome. Skips `IconButton`'s
703
- * Button stack so icon glyphs paint on the same frame as panel content, but
704
- * still wraps the trigger in the shared `Tooltip` for hover labels.
703
+ * Tooltip/Button stack so icon glyphs paint on the same frame as panel content.
705
704
  *
706
705
  * Consumers should pass decorative icons with `ariaHidden` and rely on
707
- * `aria-label` for accessible naming and tooltip text.
706
+ * `aria-label` (and the native `title` tooltip) for accessible naming.
708
707
  */
709
- const PanelIconButton = ({ "aria-label": ariaLabel, children, disabled = false, onClick, "data-testid": dataTestId, }) => (jsxRuntime.jsx(reactComponents.Tooltip, { delayed: true, disabled: disabled, interactable: false, label: ariaLabel, children: jsxRuntime.jsx("button", { "aria-label": ariaLabel, className: PANEL_ICON_BUTTON_CLASS_NAME, "data-testid": dataTestId, disabled: disabled, onClick: onClick, type: "button", children: children }) }));
708
+ const PanelIconButton = ({ "aria-label": ariaLabel, children, disabled = false, onClick, "data-testid": dataTestId, }) => (jsxRuntime.jsx("button", { "aria-label": ariaLabel, className: PANEL_ICON_BUTTON_CLASS_NAME, "data-testid": dataTestId, disabled: disabled, onClick: onClick, title: ariaLabel, type: "button", children: children }));
710
709
 
711
710
  /**
712
711
  * CSS `max-height` of the Panel shell — `min(320px, 40vh)`.
@@ -824,8 +823,7 @@ const PANEL_SCROLL_INTERNAL_CLASS_NAME = "flex flex-1 min-h-0 flex-col overflow-
824
823
  * "" — element is in DOM (for Floating UI to measure) but hidden via
825
824
  * CSS `visibility: hidden` so the pre-commit translate(0,0)
826
825
  * position is never visible.
827
- * "open" — appears instantly once placement is committed (no enter
828
- * animation — see docs/adr/0027-instant-panel-first-paint.md).
826
+ * "open" — fades in via CSS opacity transition once placement is committed.
829
827
  * "closing" — fades out during the EXIT_DURATION_MS window before unmount.
830
828
  *
831
829
  * @internal
@@ -974,9 +972,9 @@ const Panel = ({ anchor, placement = DEFAULT_PLACEMENT$1, onDismiss, closeLabel
974
972
  if (effectiveAnchor === null) {
975
973
  return null;
976
974
  }
977
- // data-panel drives the CSS visibility state machine (Panel.css):
975
+ // data-panel drives the CSS animation state machine (Panel.css):
978
976
  // "" — pre-commit: visibility:hidden so translate(0,0) is never seen
979
- // "open" — instant appearance (no enter animation)
977
+ // "open" — fade in via opacity transition
980
978
  // "closing" — fade out before unmount
981
979
  const panelState = isClosing ? "closing" : isCommitted ? "open" : "";
982
980
  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] }));
@@ -2065,10 +2063,6 @@ const computePlacement = (triggerEl, containerEl) => {
2065
2063
  const usePopoverPlacement = (triggerRef, containerRef, options = {}) => {
2066
2064
  const { skip = false } = options;
2067
2065
  const [placement, setPlacement] = react.useState(DEFAULT_PLACEMENT);
2068
- // Post-paint measurement is sufficient: both callers invoke this hook where
2069
- // the always-mounted trigger renders, so placement settles with the map —
2070
- // long before a popover can open. A layout effect would only add pre-paint
2071
- // measurement work during map load (SAGA-675 review).
2072
2066
  react.useEffect(() => {
2073
2067
  if (skip) {
2074
2068
  return;
package/index.esm.js CHANGED
@@ -4,7 +4,7 @@ import { INITIAL_CAMERA_STATE, INITIAL_MAP_STATUS, KEYBOARD_PAN_AMOUNT, KEYBOARD
4
4
  export { ANCHOR_SELECTOR, DEFAULT_MAP_APPEARANCE, HIT_SURFACE_SELECTOR, INITIAL_CAMERA_STATE, INITIAL_INTERACTION_STATE, INITIAL_MAP_STATE, INITIAL_MAP_STATUS, computeMarkerDomPortalZIndex, defineAdapter, geometryTypeToShapeType, mapAppearanceSchema, mapThemeSchema, mapTypeSchema } from '@trackunit/react-map-adapter-shared';
5
5
  import { useSyncExternalStore, useMemo, useState, useRef, useCallback, useLayoutEffect, useEffect, useReducer, createContext, useContext, memo, Suspense, useId, Fragment as Fragment$1, forwardRef } from 'react';
6
6
  import { cvaMerge } from '@trackunit/css-class-variance-utilities';
7
- import { Tooltip, useMergeRefs, Icon, Spinner, Text, useMeasure, useContainerBreakpoints, useDebounce, useWatch, useKeyboardShortcut, IconButton, ToggleGroup as ToggleGroup$1, useIsFullscreen, Popover, PopoverTrigger, PopoverContent, MoreMenu, useHover as useHover$1, cvaInteractableItem, useLocalStorageReducer } from '@trackunit/react-components';
7
+ import { useMergeRefs, Icon, Spinner, Text, useMeasure, useContainerBreakpoints, useDebounce, useWatch, useKeyboardShortcut, Tooltip, IconButton, ToggleGroup as ToggleGroup$1, useIsFullscreen, Popover, PopoverTrigger, PopoverContent, MoreMenu, useHover as useHover$1, cvaInteractableItem, useLocalStorageReducer } from '@trackunit/react-components';
8
8
  import { twMerge } from 'tailwind-merge';
9
9
  import { useFloating, autoUpdate, offset, flip, useHover, safePolygon, useInteractions, shift, hide, useDismiss, useRole } from '@floating-ui/react';
10
10
  import { createPortal } from 'react-dom';
@@ -699,13 +699,12 @@ const SHAPE_STYLE_DEFAULTS = {
699
699
  const PANEL_ICON_BUTTON_CLASS_NAME = twMerge("inline-flex h-7 w-7 shrink-0 cursor-pointer items-center justify-center rounded-md border-0 bg-transparent p-1.5 text-neutral-600", "hover:bg-black/5 hover:text-neutral-700", "active:bg-black/10 active:text-neutral-800", "focus-visible:bg-black/10 focus-visible:text-neutral-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-1", "disabled:cursor-not-allowed disabled:bg-transparent disabled:text-neutral-400");
700
700
  /**
701
701
  * Lightweight ghost icon button for map panel chrome. Skips `IconButton`'s
702
- * Button stack so icon glyphs paint on the same frame as panel content, but
703
- * still wraps the trigger in the shared `Tooltip` for hover labels.
702
+ * Tooltip/Button stack so icon glyphs paint on the same frame as panel content.
704
703
  *
705
704
  * Consumers should pass decorative icons with `ariaHidden` and rely on
706
- * `aria-label` for accessible naming and tooltip text.
705
+ * `aria-label` (and the native `title` tooltip) for accessible naming.
707
706
  */
708
- const PanelIconButton = ({ "aria-label": ariaLabel, children, disabled = false, onClick, "data-testid": dataTestId, }) => (jsx(Tooltip, { delayed: true, disabled: disabled, interactable: false, label: ariaLabel, children: jsx("button", { "aria-label": ariaLabel, className: PANEL_ICON_BUTTON_CLASS_NAME, "data-testid": dataTestId, disabled: disabled, onClick: onClick, type: "button", children: children }) }));
707
+ const PanelIconButton = ({ "aria-label": ariaLabel, children, disabled = false, onClick, "data-testid": dataTestId, }) => (jsx("button", { "aria-label": ariaLabel, className: PANEL_ICON_BUTTON_CLASS_NAME, "data-testid": dataTestId, disabled: disabled, onClick: onClick, title: ariaLabel, type: "button", children: children }));
709
708
 
710
709
  /**
711
710
  * CSS `max-height` of the Panel shell — `min(320px, 40vh)`.
@@ -823,8 +822,7 @@ const PANEL_SCROLL_INTERNAL_CLASS_NAME = "flex flex-1 min-h-0 flex-col overflow-
823
822
  * "" — element is in DOM (for Floating UI to measure) but hidden via
824
823
  * CSS `visibility: hidden` so the pre-commit translate(0,0)
825
824
  * position is never visible.
826
- * "open" — appears instantly once placement is committed (no enter
827
- * animation — see docs/adr/0027-instant-panel-first-paint.md).
825
+ * "open" — fades in via CSS opacity transition once placement is committed.
828
826
  * "closing" — fades out during the EXIT_DURATION_MS window before unmount.
829
827
  *
830
828
  * @internal
@@ -973,9 +971,9 @@ const Panel = ({ anchor, placement = DEFAULT_PLACEMENT$1, onDismiss, closeLabel
973
971
  if (effectiveAnchor === null) {
974
972
  return null;
975
973
  }
976
- // data-panel drives the CSS visibility state machine (Panel.css):
974
+ // data-panel drives the CSS animation state machine (Panel.css):
977
975
  // "" — pre-commit: visibility:hidden so translate(0,0) is never seen
978
- // "open" — instant appearance (no enter animation)
976
+ // "open" — fade in via opacity transition
979
977
  // "closing" — fade out before unmount
980
978
  const panelState = isClosing ? "closing" : isCommitted ? "open" : "";
981
979
  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] }));
@@ -2064,10 +2062,6 @@ const computePlacement = (triggerEl, containerEl) => {
2064
2062
  const usePopoverPlacement = (triggerRef, containerRef, options = {}) => {
2065
2063
  const { skip = false } = options;
2066
2064
  const [placement, setPlacement] = 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).
2071
2065
  useEffect(() => {
2072
2066
  if (skip) {
2073
2067
  return;
package/package.json CHANGED
@@ -1,22 +1,22 @@
1
1
  {
2
2
  "name": "@trackunit/react-map",
3
- "version": "0.2.46",
3
+ "version": "0.2.48-alpha-90b6c9b97dd.0",
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.4.0",
11
- "@trackunit/css-class-variance-utilities": "1.13.90",
12
- "@trackunit/react-form-components": "2.3.6",
13
- "@trackunit/react-core-hooks": "1.19.5",
14
- "@trackunit/geo-json-utils": "1.14.93",
15
- "@trackunit/i18n-library-translation": "2.2.5",
10
+ "@trackunit/react-components": "2.4.2-alpha-90b6c9b97dd.0",
11
+ "@trackunit/css-class-variance-utilities": "1.13.92-alpha-90b6c9b97dd.0",
12
+ "@trackunit/react-form-components": "2.3.8-alpha-90b6c9b97dd.0",
13
+ "@trackunit/react-core-hooks": "1.19.7-alpha-90b6c9b97dd.0",
14
+ "@trackunit/geo-json-utils": "1.14.95-alpha-90b6c9b97dd.0",
15
+ "@trackunit/i18n-library-translation": "2.2.7-alpha-90b6c9b97dd.0",
16
16
  "react-minimal-pie-chart": "^8.4.0",
17
- "@trackunit/react-map-adapter-shared": "0.0.74",
18
- "@trackunit/react-map-color-utils": "0.0.59",
19
- "@trackunit/ui-design-tokens": "1.13.89",
17
+ "@trackunit/react-map-adapter-shared": "0.0.76-alpha-90b6c9b97dd.0",
18
+ "@trackunit/react-map-color-utils": "0.0.61-alpha-90b6c9b97dd.0",
19
+ "@trackunit/ui-design-tokens": "1.13.91-alpha-90b6c9b97dd.0",
20
20
  "@floating-ui/react": "^0.26.25",
21
21
  "es-toolkit": "^1.39.10",
22
22
  "tailwind-merge": "^2.0.0",
@@ -56,8 +56,7 @@ 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" — appears instantly once placement is committed (no enter
60
- * animation — see docs/adr/0027-instant-panel-first-paint.md).
59
+ * "open" — fades in via CSS opacity transition once placement is committed.
61
60
  * "closing" — fades out during the EXIT_DURATION_MS window before unmount.
62
61
  *
63
62
  * @internal
@@ -8,10 +8,9 @@ export type PanelIconButtonProps = Readonly<{
8
8
  }>;
9
9
  /**
10
10
  * Lightweight ghost icon button for map panel chrome. Skips `IconButton`'s
11
- * Button stack so icon glyphs paint on the same frame as panel content, but
12
- * still wraps the trigger in the shared `Tooltip` for hover labels.
11
+ * Tooltip/Button stack so icon glyphs paint on the same frame as panel content.
13
12
  *
14
13
  * Consumers should pass decorative icons with `ariaHidden` and rely on
15
- * `aria-label` for accessible naming and tooltip text.
14
+ * `aria-label` (and the native `title` tooltip) for accessible naming.
16
15
  */
17
16
  export declare const PanelIconButton: ({ "aria-label": ariaLabel, children, disabled, onClick, "data-testid": dataTestId, }: PanelIconButtonProps) => ReactElement;
@@ -1 +0,0 @@
1
- {"version":3,"file":"entry.js","sourceRoot":"","sources":["../../../../../libs/react/map/migrations/entry.ts"],"names":[],"mappings":"","sourcesContent":["export {};\n"]}