@moneyforward/mfui-components 4.1.1 → 4.1.2

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.
@@ -2,5 +2,8 @@ import { type GlobalHeaderProps } from './GlobalHeader.types';
2
2
  /**
3
3
  * The global header component.
4
4
  * The global header component is a top-level navigation component that is used to display the application's logo and navigation elements.
5
+ *
6
+ * `GlobalHeader` should generally be paired with `MainNavigation` for the primary navigation area.
7
+ * If you need a self-contained layout that already includes both header and navigation features, use `Sidebar` instead.
5
8
  */
6
9
  export declare function GlobalHeader({ className, mainNavigationButtonProps, applicationsMenuSlot, experimentalApplicationsMenuButtonProps, logoSlot, rightPaneSlot, disableResponsive, }: GlobalHeaderProps): import("react/jsx-runtime").JSX.Element;
@@ -8,6 +8,9 @@ import { ApplicationsExperimentalIcon } from './ApplicationsExperimentalIcon';
8
8
  /**
9
9
  * The global header component.
10
10
  * The global header component is a top-level navigation component that is used to display the application's logo and navigation elements.
11
+ *
12
+ * `GlobalHeader` should generally be paired with `MainNavigation` for the primary navigation area.
13
+ * If you need a self-contained layout that already includes both header and navigation features, use `Sidebar` instead.
11
14
  */
12
15
  export function GlobalHeader({ className, mainNavigationButtonProps, applicationsMenuSlot, experimentalApplicationsMenuButtonProps, logoSlot, rightPaneSlot, disableResponsive = false, }) {
13
16
  const responsive = !disableResponsive;
@@ -5,5 +5,8 @@ import { type MainNavigationProps, type MainNavigationRef } from './MainNavigati
5
5
  *
6
6
  * When the viewport is narrow, the navigation will be displayed as a drawer.
7
7
  * When the viewport is not narrow, the navigation will be displayed as a sidebar.
8
+ *
9
+ * `MainNavigation` is intended to be paired with `GlobalHeader`. If you need a self-contained
10
+ * layout that already includes both header and navigation features, use `Sidebar` instead.
8
11
  */
9
12
  export declare const MainNavigation: import("react").ForwardRefExoticComponent<MainNavigationProps & import("react").RefAttributes<MainNavigationRef>>;
@@ -8,6 +8,9 @@ import { NarrowViewportMainNavigation } from './NarrowViewportMainNavigation';
8
8
  *
9
9
  * When the viewport is narrow, the navigation will be displayed as a drawer.
10
10
  * When the viewport is not narrow, the navigation will be displayed as a sidebar.
11
+ *
12
+ * `MainNavigation` is intended to be paired with `GlobalHeader`. If you need a self-contained
13
+ * layout that already includes both header and navigation features, use `Sidebar` instead.
11
14
  */
12
15
  export const MainNavigation = forwardRef(({ className, featureShortcut, navigationItems, disableResponsive = false, width = 'normal', customLinkComponent, enableCollapsible, nestedNavigationDisplay, isCollapsed, onCollapsedChange, collapseButtonProps, expandButtonProps, }, ref) => {
13
16
  const commonProps = {
@@ -56,10 +56,14 @@ export function useSidePaneStateController({ open, onClose, ref, insideElement }
56
56
  // Autofocus to the pane window (`role="dialog"` element) when it opens.
57
57
  // Screen readers honor `aria-modal` only when focus is on the `role="dialog"`
58
58
  // element or its descendants, so the root wrapper must not be the focus target.
59
+ // `preventScroll` is required because the pane window starts outside its container
60
+ // (the slide-in animation begins at `right: -100%`). Without it the browser scrolls
61
+ // the container to reveal the pane, which shifts the surrounding content and hides
62
+ // the animation — `overflow: hidden` containers are still programmatically scrollable.
59
63
  useEffect(() => {
60
64
  if (!localOpen)
61
65
  return;
62
- (insideElement ?? sidePaneElement)?.focus();
66
+ (insideElement ?? sidePaneElement)?.focus({ preventScroll: true });
63
67
  }, [insideElement, sidePaneElement, localOpen]);
64
68
  return {
65
69
  localOpen,
@@ -10,6 +10,9 @@ declare function SidebarBase({ className, logoSlot, mainNavigationItems, extraNa
10
10
  * A navigation layout component that combines a logo header, a navigation area,
11
11
  * and a footer with icon menu and user information.
12
12
  *
13
+ * `Sidebar` is a self-contained alternative to `GlobalHeader` and `MainNavigation`, since it
14
+ * already includes both header and navigation features.
15
+ *
13
16
  * The width is resizable via the drag handle on the right edge. See the `WidthPersistence` story for
14
17
  * an example of persisting the width across reloads via `onWidthChange` and `defaultWidth`.
15
18
  *
@@ -51,6 +51,9 @@ function SidebarToggleButton({ isCollapsed, ariaLabel, navId, onClick, }) {
51
51
  * A navigation layout component that combines a logo header, a navigation area,
52
52
  * and a footer with icon menu and user information.
53
53
  *
54
+ * `Sidebar` is a self-contained alternative to `GlobalHeader` and `MainNavigation`, since it
55
+ * already includes both header and navigation features.
56
+ *
54
57
  * The width is resizable via the drag handle on the right edge. See the `WidthPersistence` story for
55
58
  * an example of persisting the width across reloads via `onWidthChange` and `defaultWidth`.
56
59
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moneyforward/mfui-components",
3
- "version": "4.1.1",
3
+ "version": "4.1.2",
4
4
  "description": "React UI Component Library for all Money Forward products",
5
5
  "repository": {
6
6
  "type": "git",
@@ -63,8 +63,8 @@
63
63
  "@floating-ui/react-dom": "^2.1.2",
64
64
  "@tanstack/react-virtual": "^3.13.18",
65
65
  "dayjs": "^1.11.13",
66
- "@moneyforward/mfui-icons-react": "^4.0.0",
67
- "@moneyforward/mfui-design-tokens": "^4.0.0"
66
+ "@moneyforward/mfui-design-tokens": "^4.0.0",
67
+ "@moneyforward/mfui-icons-react": "^4.0.0"
68
68
  },
69
69
  "scripts": {
70
70
  "prepare:panda": "panda codegen",