Skip to content

Latest commit

 

History

History
1410 lines (1008 loc) · 38.8 KB

CHANGELOG.md

File metadata and controls

1410 lines (1008 loc) · 38.8 KB

@leafygreen-ui/menu

28.0.2

Patch Changes

28.0.1

Patch Changes

28.0.0

Major Changes

  • 274d7e1a7: Removes prop-types from LeafyGreen UI

Patch Changes

27.0.0

Major Changes

  • 04bb887c0: LG-4121: Replaces usePortal prop with renderMode prop. renderMode="inline" and renderMode="portal" are deprecated, and all popover elements should migrate to using the top layer. The old default was usePortal=true, and the new default is renderMode="top-layer".

    See @leafygreen-ui/popover package 12.0.0 changelog for more info.

    Additional changes include:

    • Deprecates and removes justify="fit". Instead, use justify="middle"

    Migration guide

    Use popover-v12 codemod for migration assistance.

    Old
    <Menu popoverZIndex={9999} usePortal={false} />
    <Menu portalClassName="portal-class" usePortal />
    New
    <Menu popoverZIndex={9999} renderMode="inline" />
    <Menu portalClassName="portal-class" renderMode="portal" />

Patch Changes

26.0.0

Major Changes

  • 08112c810: LG-4630: Apply highlight to first menu item only when opened with keyboard

25.1.3

Patch Changes

  • 5f10976d5: - Updates useAvailableSpace hook which fixes a dropdown height bug. LG-4601.

25.1.2

Patch Changes

Note: This version has no updates. Pleas use version 25.1.3.

  • Updates useAvailableSpace hook which fixes a dropdown height bug. LG-4601

25.1.1

Patch Changes

  • af96e3967: LG-4422 Update chevron icon to properly indicate if interaction will expand or collapse and add animation
  • Updated dependencies [e7bc12814]
  • Updated dependencies [c1b8b633b]
  • Updated dependencies [ecae9acc7]
  • Updated dependencies [fe2483937]

25.1.0

Minor Changes

  • 409377e19: Adds additional exports:
    • MenuDescendantsContext
      • Used to register and consume Menu descendants
      • This context value allows you to register and track custom menu items
    • Context hooks useMenuContext, useMenuGroupContext, & useSubMenuContext, along with types types MenuContextData, MenuGroupContextData, & SubMenuContextData,
      • use these to read context data from custom menu item components
    • menuColor: Custom color tokens used within Menu and related components
    • MenuInteractionState: Enumerates interaction states on a menu item
    • LGIDs: Unique ids for menu elements
    • menuItemClassName: The unique class name for menu item components
    • subMenuContainerClassName & subMenuToggleClassName
      • Unique classnames for submenu elements

Patch Changes

25.0.1

Patch Changes

  • 4c04aa0ee: Update Menu to use latest Descendants API
  • Updated dependencies [4c04aa0ee]
  • Updated dependencies [66e5665e8]
  • Updated dependencies [4c04aa0ee]
  • Updated dependencies [4c04aa0ee]

25.0.0

Major Changes

  • cfa830701: Internally refactors Menu to leverage @leafygreen-ui/descendants. This improvement will enable faster feature development and bug fixes in the future.
  • cfa830701: Implements InputOption within MenuItem.
    • Aligns spacing & colors with other dropdown menus.
    • Also creates additional MenuItem generated stories
  • cfa830701: - Updates the FocusableMenuItem component for new menu descendants pattern. By wrapping an input component in FocusableMenuItem, it will be registered as a menu item descendant, and will be focusable using standard menu arrow key interactions.
    • Note: the single child of FocusableMenuItem must itself be focusable. Wrapping a focusable element (e.g. input in a div) will not enable the menu descendant functionality.

Minor Changes

  • cfa830701: Adds title and glyph props to MenuGroup. Providing a title to MenuGroup will visually indent the child MenuItem components, appearing nested within the group.

  • cfa830701: ## Features

    • Clicking a submenu item that does not have a click handler or href will toggle the submenu
    • When focused on a submenu item, pressing the left/right arrow keys will close/open the menu (respectively)

    Structural changes

    • Updates Submenu component to use InputOption
    • Moves the submenu toggle button to be a sibling of the InputOption
      • this avoids any potential nesting of button elements

Patch Changes

  • cfa830701: Ensures SubMenu does not toggle open/closed when disabled
  • cfa830701: Fixes a bug where click handlers on MenuItem or SubMenu would still fire when disabled
  • Updated dependencies [cfa830701]
  • Updated dependencies [cfa830701]
  • Updated dependencies [cfa830701]
  • Updated dependencies [cfa830701]
  • Updated dependencies [db2d1d12c]
  • Updated dependencies [cfa830701]
  • Updated dependencies [cfa830701]

24.2.1

Patch Changes

24.2.0

Minor Changes

  • 02e1d77e: Expose portalRef in components that use Popover:

    • Combobox
    • DatePicker
    • GuideCue
    • Menu
    • NumberInput
    • Select
    • SplitButton
    • Tooltip

    LG-3988

Patch Changes

24.1.0

Minor Changes

  • 433616d4: Exports MenuGroup from package

Patch Changes

24.0.0

Major Changes

  • 1d55530b: Removes the closing of Menu on MenuItem click. This behavior was causing issues with clickable items inside of MenuItem. To control when Menu closes, use open and setOpen. LG-4130

23.0.3

Patch Changes

23.0.2

Patch Changes

23.0.1

Patch Changes

23.0.0

Major Changes

  • 2724d6b7: - Updates dark mode Menu. Previously Menu had an inverted light theme in dark mode but now Menu will have a dark theme in dark mode. Light mode and dark mode will have different dark themes.
    • Adds a 1px border around the menu dropdown.

Minor Changes

  • 7c3e6d39: Adds initialOpen prop, which allows consuming applications to control the initial state of an uncontrolled implementation of the component.

Patch Changes

22.0.9

Patch Changes

  • b15c4805: Adds variant prop to MenuItem component. The value can either be 'default' or 'destructive'

22.0.8

Patch Changes

22.0.7

Patch Changes

22.0.6

Patch Changes

22.0.5

Patch Changes

22.0.4

Patch Changes

22.0.3

Patch Changes

22.0.2

Patch Changes

  • 735342e9: Reduce the number of re-renders and fixes a bug that prevented a previously opened menu from closing on the opening of another menu.
  • 76161cf0: Updates stories for Chromatic testing
  • Updated dependencies [76161cf0]
  • Updated dependencies [76161cf0]
  • Updated dependencies [735342e9]
  • Updated dependencies [95f5107a]
  • Updated dependencies [76161cf0]
  • Updated dependencies [76161cf0]
  • Updated dependencies [76161cf0]

22.0.1

Patch Changes

  • 63b2deb0b: Upgrade button to v20.1.1
  • Updated dependencies [63b2deb0b]

22.0.0

Major Changes

  • c0699a0df: Clicking on a MenuItem closes the Menu component
  • 0cd471676: Refactor Menu to use forwardRef.

Patch Changes

21.0.0

Major Changes

  • bdc11b5be: When you press the tab key within a menu that is open, it will no longer cycle through the available options. Rather, the menu will close and the focus will shift to the trigger of the menu.

Patch Changes

  • f2ae45924: Fixes flakey menu tests
  • 73cbbd02c: Uses fontWeight token from @leafygreen-ui/tokens
  • Updated dependencies [73cbbd02c]
  • Updated dependencies [8ece56980]
  • Updated dependencies [83fc5b31b]
  • Updated dependencies [8ece56980]
  • Updated dependencies [32b3d3146]

20.0.3

Patch Changes

20.0.2

Patch Changes

20.0.1

Patch Changes

20.0.0

Major Changes

  • 2f732ca50: Migrate component to use Polymorphic instead of Box internally. This should allow better support of the styled API. Additionally, this fixes a bug with the as prop, which should now work as expected and allow consuming applications to choose what component MenuItem and SubMenu components are rendered as.

Patch Changes

19.0.4

Patch Changes

19.0.3

Patch Changes

  • 33a5dac82: Updates disabled and focus styles.

19.0.2

Patch Changes

19.0.1

Patch Changes

  • 1a335d0b2: Migrate component internals to check for glyphs explicity, rather than for Icon components as well
  • ae5421cf6: Updates components to use internal transition tokens
  • Updated dependencies [ae5421cf6]
  • Updated dependencies [4b4c2d27d]
  • Updated dependencies [1a335d0b2]
  • Updated dependencies [ae5421cf6]

19.0.0

Patch Changes

18.0.0

Major Changes

  • f2d63a60: Removes leafygreen data attributes (prefixed with data-leafygreen-ui-), and replaces them with deterministic classNames (prefixed with lg-ui-)

Patch Changes

17.0.0

Patch Changes

16.1.1

Patch Changes

16.1.0

Minor Changes

  • 3690df49: Updates TypeScript annotations, type structures and export format of some components

Patch Changes

16.0.0

Major Changes

  • a1202635: Adds a call to event.nativeEvent.stopPropagation() on trigger click, preventing the native event from propagating, while still allowing the React synthetic event to bubble. This ensures clicks on the trigger do not close the menu in hybrid/multi-framework apps

Patch Changes

15.0.1

Patch Changes

  • cdbbe4a2: Fix background color appearing when clicking on a disabled menu item
  • fdd1cbbf: Adds missing dependencies
  • Updated dependencies [30e038a3]

15.0.0

Major Changes

  • 5aba12f1: - Update Menu for dark mode brand refresh.
    • Adds darkMode prop to determine whether or not the component will render in dark theme.
    • Adds vertical spacing to MenuSeparator.
    • Increase default maxHeight to 344px.
    • Fixing bug where passing color styles to MenuItem using the className prop was being overwritten.

Patch Changes

  • 5aba12f1: Prevents the page from scrolling on up/down arrow key press when the menu is open

14.0.2

Patch Changes

  • f9846f68: When a menu is closed with the Escape key, the trigger will regain focus

14.0.1

Patch Changes

  • c897e216: Removes flicker in the active wedge

14.0.0

Patch Changes

13.1.1

Patch Changes

  • fad2b287: Fixes a bug where occasionally the max menu height would be set to 0 if a ref was left unset

13.1.0

Minor Changes

  • 6792bc44: Adds a maxHeight prop. Menu will automatically restrict its height to the smallest of maxHeight and the available vertical space (using the hook useAvailableSpace).

Patch Changes

13.0.1

Patch Changes

  • bc2558c5: Adding named exports for select components and types
  • Updated dependencies [bc2558c5]

13.0.0

Major Changes

Patch Changes

12.2.0

Minor Changes

  • 24d31147: Allows custom props to be passed to MenuItem components inside Menu/SubMenu

Patch Changes

12.1.0

Minor Changes

  • acd6919: Updates MenuSeparator to optionally accept a className prop

Patch Changes

  • acd6919: Removes an undocumented change where both href and description would be rendered if provided to MenuItem. Now only description will be rendered.
  • acd6919: - Eliminates fuzzy text on hover in menu and tabs
  • Updated dependencies [acd6919]
  • Updated dependencies [acd6919]
  • Updated dependencies [acd6919]

12.0.0

Major Changes

  • 8457f92: Updates Menu in line with visual brand refresh. Note: menus are now dark with light text

Patch Changes

11.0.1

Patch Changes

11.0.0

Major Changes

  • 8409a9ea: Styles text on the MenuItem container such that styles can be overwritten by consuming applications

10.0.3

Patch Changes

10.0.2

Patch Changes

  • 4b7b7322: Adds role='presentation' to glyphs rendered before menu items

10.0.1

Patch Changes

  • 5bb0e25f: CaretIcons no longer announced to scren readers, since they are not focusable
  • a4d3f000: Updates icons in inactive menu and submenu items to uiColors.gray.dark1

10.0.0

Minor Changes

  • 857a680a: Adds support for positioning popover elements relative to elements within a scroll container other than the window. Adds support for setting z-index on popover elements with the zIndex prop.

Patch Changes

9.1.4

Patch Changes

9.1.3

Patch Changes

  • 4b387979: Adds role="none" to li element in MenuItem component

9.1.2

Patch Changes

  • f3523462: Implementation update that avoids some unnecessary rerenders

9.1.1

Patch Changes

  • ee7923d3: Changes how we extend the types of HTMLElements, and standardizes how we document this across readmes
  • Updated dependencies [ee7923d3]
  • Updated dependencies [627333c2]

9.1.0

Minor Changes

  • c18f16e6: Improves compatibility with React v17

Patch Changes

9.0.2

Patch Changes

  • f7b3d668: Fixes issue where scrollbar is always visible

9.0.1

Patch Changes

9.0.0

Major Changes

  • 0267bfd2: The underlying structure of distributed module definition files have changed and now have official support for ES modules. Module definition files are now generated using Rollup instead of Webpack. This should not affect functionality, but some thorough testing and caution should be exercised when upgrading.

Patch Changes

8.0.0

Major Changes

  • a18b4e1b: Menus are now scrollable when their contents exceed their size. Previously the excess content would be hidden.

Patch Changes

7.0.10

Patch Changes

7.0.9

Patch Changes

  • 47846c77: Fixes unintentional exclusion of ref from TypeScript typing of props for Button, SubMenu, and MenuItem components.
  • Updated dependencies [a84219f1]

7.0.8

Patch Changes

7.0.7

Patch Changes

7.0.6

Patch Changes

7.0.5

Patch Changes

7.0.4

Patch Changes

7.0.3

Patch Changes

  • e8f5376: Ensures that only props that are of type string are recognized as being passed to the href prop.
  • Updated dependencies [e8f5376]
  • Updated dependencies [4873650]

7.0.2

Patch Changes

  • 083eec3: Remove usage of Element in Node target builds that was preventing rendering the component in SSR contexts.
  • Updated dependencies [083eec3]
  • Updated dependencies [083eec3]
  • Updated dependencies [27f8ea1]
  • Updated dependencies [27f8ea1]

7.0.1

Patch Changes

  • 0593116: Uses enhanced ExtendableBox type to set smarter default as component in MenuItem and SubMenu
  • Updated dependencies [0593116]

7.0.0

Major Changes

  • 1d24966: Makes @leafygreen-ui/leafygreen-provider a peer dependency to ensure that components use hooks from the same version of the provider as what's installed.

6.0.14

Patch Changes

6.0.13

Patch Changes

  • 1d86d56: Imports Glyphs directly, rather than importing the entire Icon package, when Glyph components are used
  • Updated dependencies [1d86d56]
  • Updated dependencies [1d86d56]

6.0.12

Patch Changes

6.0.11

Patch Changes

  • 05779a1: Upgrades react-transition-group to 4.4.1 which removes all React StrictMode warnings, making these components StrictMode safe.
  • Updated dependencies [2fc4ef9]
  • Updated dependencies [05779a1]
  • Updated dependencies [e857861]
  • Updated dependencies [cf6167e]

6.0.10

Patch Changes

  • a11b521: Fixes issue with SubMenu, such that open is now set by Menu when the Menu itself is open

6.0.9

Patch Changes

6.0.8

Patch Changes

  • 0391d01: Fixes style bug when MenuItem is focused and rendered as anchor tag
  • Updated dependencies [2176b77]

6.0.7

Patch Changes

6.0.6

Patch Changes

6.0.5

Patch Changes

  • 64c03e7: Fixes SubMenuIcon padding to account for change in size of xlarge glyphs
  • Updated dependencies [bc47b13]
  • Updated dependencies [1b298cc]

6.0.4

Patch Changes

6.0.3

Patch Changes

  • dd342f5: MenuItem component renders any ReactElement description, rather than only strings.
  • Updated dependencies [e1568c6]

6.0.2

Patch Changes

  • cda96b2: Updates text color when MenuItem is focused

6.0.1

Patch Changes

6.0.0

Major Changes

  • 786ccf1:
    • Changes glyph prop from string to React.ReactElement in SubMenu component
    • Adds glyph and size props to MenuItem component

Minor Changes

  • 690888a: Adds spacing prop to Menu component

Patch Changes

5.1.0

Minor Changes

  • fabc1c9:
    • MenuItems accept an as prop to determine what component to render as.
    • Introduces SubMenu components with stronger accessibility logic

Patch Changes

5.0.0

Major Changes

  • 464c09d: Introduces SSR compatibility though a change to our build process and files

Minor Changes

  • 5c9202d: Introduces support for LeafyGreenProvider for improved focus state management

Patch Changes

4.0.3

Patch Changes

  • 8c2e838: Updates styles to fix bugs on Safari and Firefox

4.0.2

Patch Changes

  • ad74307: Changes default behavior in MenuItems with anchor tags, such that the default is to target="\_self", and ensures ability of consumer to override the default
  • ff55bb5: Updates anchor styles to minimize overrides
  • baf45f6: Allows target and rel props to be passed to MenuItem, when MenuItem is a link

4.0.1

Patch Changes

  • 2f9a300: Uses exported keyMap from lib
  • 759523f: Adds border-box property to MenuItems and update documentation
  • Updated dependencies [2f9a300]

4.0.0

Major Changes

  • 9c45cb4: Traps focus within the Menu when Menu is open and keyboard navigation is now accessible
  • f6b6b7a: No longer renders children of Popover component to the DOM when the Popover is closed

Patch Changes

  • 319fb82: Updates PropTypes based on eslint updates
  • Updated dependencies [9c45cb4]
  • Updated dependencies [f6b6b7a]

3.0.3

3.0.2

Patch Changes

  • 3a24668: Replaces existing Escape handling with new useEscapeKey hook

3.0.1

Patch Changes

  • aaa895e:
    • Fixes storybook, such that it reflects a generic Menu rather than MongoMenu
    • Fixes bug with disabled MenuItem styles

3.0.0

Major Changes

  • 23c7d20: Changes the semantic HTML for MenuItem component, as well as updates the styles of the entire Menu, which involves removing @leafygreen-ui/theme as a dependency and adding @leafygreen-ui/palette.

Patch Changes

  • ec4d8da: Removes role='menu' from MenuGroup in order to make component accessible

2.0.0

Major Changes

  • 7825641:
    • Updates Menu API, such that the controlled version now accepts open and setOpen props. Using setOpen allows leafygreen to handle backdrop clicks and Escape key-presses for consuming applications.
    • Previously the prop that controlled whether or not the Menu component would appear as open was called active, now the prop's name is open.
    • Adds setOpen prop to allow leafygreen to help a consuming application, using the controlled api, close Menu component when backdrop is clicked or escape key is pressed.
    • Adds shouldClose prop, so that consuming application can opt-out of default closing behavior.