Mar 31, 2023
  • MenuRenderer: Hide overflow on menu

    Fixes a bug where the selection/highlight for a MenuItem could extend outside of the menu itself.

  • Add xxxlarge to the space scale

    Extends the range of the space scale to include xxxlarge. This addition is to support an upcoming design uplift that requires greater fidelity in the scale. Note, the new value is also available as a responsive property.

    EXAMPLE USAGE:

    <Stack space="xxxlarge">...</Stack>
    
    {/* Or responsively: */}
    <Stack space={{ mobile: 'large', tablet: 'xxxlarge' }}>...</Stack>
    import { atoms } from 'braid-design-system/css';
    
    atoms({ paddingY: 'xxxlarge' })
    import { vars } from 'braid-design-system/css';
    
    const space = vars.space.xxxlarge;
Nov 9, 2022
  • Support data attribute boolean values

    The data attribute map now supports boolean values. This provides an improvement for the developer experience, no longer having to convert values to strings explicitly.

    EXAMPLE USAGE:

    <Component
      data={{
        'custom-attribute': true,
      }}
    />
    // => <div data-custom-attribute="true" />
May 24, 2022
  • MenuRenderer, OverflowMenu: Provide context data to onClose

    The onClose handler now receives data to allow consumers to discern why the menu closed — either by exiting or selecting an action. See the documentation for more details.

    EXAMPLE USAGE:

    <MenuRenderer
      onClose={(closeReason) => {
        // ...
      }}
    />
Apr 8, 2022
  • MenuRenderer, OverflowMenu: Guard against open/close handlers firing incorrectly

    Add guard to ensure open and close handlers are not re-fired when handler instances are updated.

Mar 23, 2022
  • MenuRenderer, OverflowMenu: Mouse leave no longer affects focus state

    Previously, moving the mouse from hovering a menu item to outside of the menu would shift focus the to the menu trigger. This is not a requirement for accessibility and introduces undesired behaviour when the trigger is used in conjunction with TooltipRenderer.

    Note: As per the menu accessibility guidelines, focus will still be returned to the trigger when clicking outside the menu, selecting a menu item or pressing the escape key.

Mar 7, 2022
  • MenuRenderer, OverflowMenu: Add menu width and placement support

    Provides a set of widths to control how wide the menu is, where content is the default. The available widths are ratioed off the contentWidths specified on the theme.

    Additionally the placement of the menu can choose from either top or bottom where the latter remains the default.

    EXAMPLE USAGE:

    <MenuRenderer
      // ...
      width="small"
      placement="top">
      ...
    </MenuRenderer>
  • MenuItem, MenuItemLink, MenuRenderer, OverflowMenu: Add icon support

    Provides a designed slot for adding an icon to MenuItem and MenuItemLink. To compliment this we have introduced reserveIconSpace on both MenuRenderer and OverflowMenu so the labels in menu items without icons align with the labels of menu items with an icon.

    EXAMPLE USAGE:

    <MenuRenderer reserveIconSpace>
      <MenuItem
        // ...
        icon={<IconBookmark />}
      >
        Menu Item
      </MenuItem>
    </MenuRenderer>
Jan 27, 2022
  • MenuRenderer, OverflowMenu: Ensure layout of the trigger is controlled by the parent

    Fixes an issue where the trigger container did not adhere to the parent layout, preventing consumers from providing triggers that take up the full width of their available space. This goes against one of Braid's key layout principles which says spacing between elements is owned entirely by layout components.

Aug 20, 2021
  • Alert, Badge, Button, ButtonLink, ButtonRenderer, Card, Dialog, MenuRenderer, OverflowMenu, Pagination, TooltipRenderer, useToast: Increase border radius using updated borderRadius scale

Jul 8, 2021
  • Add wide breakpoint of 1200px

    This adds support for wide to the following touchpoints:

    • Responsive values, e.g.
      { mobile: 'small', wide: 'large' }
    • Responsive range props, e.g.
      <Columns collapseBelow="wide" space={{ mobile: 'small', wide: 'large' }}>
    • The responsiveStyle function, e.g.
      export const className = style(responsiveStyle({ wide: '...' }));
    • The breakpoints object, which now exposes the number 1200 via breakpoints.wide, i.e.
      {
        mobile: 0,
        tablet: 740,
        desktop: 940,
        wide: 1200
      }
Jun 21, 2021
  • Support object notation for responsive props

    Responsive prop values can now be written as objects with named breakpoints, which is now the recommended notation.

    { mobile: 'small', tablet: 'medium', desktop: 'large' }

    This also means that breakpoints can be skipped.

    { mobile: 'small', desktop: 'large' }
Dec 16, 2020
  • OverflowMenu, MenuRenderer, MenuItemDivider: Remove horizontal padding

Sep 14, 2020
  • MenuRenderer, OverflowMenu: Fix circular dependency issue

Apr 9, 2020
  • Drop lodash usage to decrease bundle size.

    This directly affects MonthPicker and any components using the data prop:

    • All field components
    • OverflowMenu
    • MenuRenderer
    • Button
Mar 17, 2020
  • MenuRenderer: Add support for configuring the menu offset from the trigger

    FEATURES

    MenuRenderer

    Configure the offset distance between the menu trigger and menu using the offsetSpace prop. As with all space values in the system, this accepts a responsive prop.

     <MenuRenderer
    +  offsetSpace="small"
       trigger={(triggerProps, { open }) => (
         <button {...triggerProps}>Menu</button>
       )}
     >
       <MenuItem onClick={...}>Option</MenuItem>
     </MenuRenderer>
Mar 13, 2020
  • Add customisable MenuRenderer component

    BREAKING CHANGES

    • Rename OverflowMenuItem to MenuItem.
    • Removed type="link" from OverflowMenuItem due to an accessibility issue with the approach (based on review of consumer usage, it did not seem to be used).

    FEATURES

    MenuRenderer

    Encapsulates all the behaviours of an accessible menu button, allowing consumers to define a custom trigger to open the menu. The trigger function receives two arguments:

    • Props required for accessibility, including mouse/keyboard interactions
    • Menu state object containing the open state.
    <MenuRenderer
      trigger={(triggerProps, { open }) => (
        <button {...triggerProps}>Menu</button>
      )}
    >
      <MenuItem onClick={...}>Option</MenuItem>
    </MenuRenderer>

    MIGRATION GUIDE

    OverflowMenuItem

    Rename OverflowMenuItem to MenuItem.

     <OverflowMenu label="Overflow">
    -  <OverflowMenuItem onClick={...}>Option</OverflowMenuItem>
    +  <MenuItem onClick={...}>Option</MenuItem>
     </OverflowMenu>

    Changing the type is no longer supported due to an accessibility issue with the previous implementation. Please get in contact via Slack if you depended on this.

     <OverflowMenu label="Overflow">
    -  <OverflowMenuItem type="link" onClick={...}>Option</OverflowMenuItem>
    +  <MenuItem onClick={...}>Option</MenuItem>
     </OverflowMenu>