Giter Club home page Giter Club logo

base5-ui's People

Contributors

5app-machine avatar cboyce183 avatar dependabot[bot] avatar diondiondion avatar ghernandez345 avatar greenkeeper[bot] avatar humancatfood avatar ikhemissi avatar mistersomebody avatar mrswitch avatar renovate-bot avatar renovate[bot] avatar sarahhouben avatar semantic-release-bot avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

juliantreweeke

base5-ui's Issues

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Location: renovate.json
Error type: The renovate configuration file contains some invalid settings
Message: matchUpdateTypes: matchUpdateTypes should be inside a 'packageRule' only

An in-range update of eslint-config-5app is breaking the build 🚨

The devDependency eslint-config-5app was updated from 0.8.4 to 0.8.5.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

eslint-config-5app is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • βœ… ci/circleci: checkout_code: Your tests passed on CircleCI! (Details).
  • ❌ ci/circleci: test: Your tests failed on CircleCI (Details).

Release Notes for v0.8.5

0.8.5 (2020-03-02)

Bug Fixes

  • deps: update dependency eslint-plugin-jsdoc to v22 (a3c6bb5)
Commits

The new version differs by 2 commits.

  • fce8580 chore(release): 0.8.5 [skip ci]
  • a3c6bb5 fix(deps): update dependency eslint-plugin-jsdoc to v22

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Prevent Modal from re-registering & resetting focus when `onRequestClose` is mutated

When the close handler of the Modal component is recreated during a render while the modal is open, it will unregister & immediately re-register the modal. This will mutate the modalStack and cause the user's focus to be reset to whichever element caused the previous render.

This re-registering & focus reset shouldn't happen, as Modals should only unregister when they're actually closed. One way to prevent this would be to store the latest reference to the onRequestClose handler in a React ref inside of useModalManager. This ref can be mutated without causing a re-registration, and without risking a stale close handler (which would be the result of simply removing the prop from the effect's dependency array).

To recreate the bug:

const [someState, setSomeState] = React.useState('');
const [someOtherState, setSomeOtherState] = React.useState('');

<Modal
	name="modal"
	onRequestClose={() => {}}
	aria-labelledby="modal"
>
	<input type="text" value={someState} onChange={e => setSomeState(e.target.value)} />
	<input type="text" value={someOtherState} onChange={e => setSomeOtherState(e.target.value)} />
</Modal>

Typing into one of the inputs, then moving to another input, should get you into a "focus loop" where focus is continuously moved back and forth between both inputs as you type, as the modal's close handler is recreated on every state update.

The fix in this scenario is to either memoise the function passed to onRequestClose, or in this case to simply move it outside of the component definition.

An in-range update of babel7 is breaking the build 🚨

There have been updates to the babel7 monorepo:

    • The devDependency @babel/cli was updated from 7.6.2 to 7.6.3.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

This monorepo update includes releases of one or more dependencies which all belong to the babel7 group definition.

babel7 is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • βœ… ci/circleci: checkout_code: Your tests passed on CircleCI! (Details).
  • ❌ ci/circleci: test: Your tests failed on CircleCI (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of babel7 is breaking the build 🚨

There have been updates to the babel7 monorepo:

    • The devDependency @babel/cli was updated from 7.6.3 to 7.6.4.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

This monorepo update includes releases of one or more dependencies which all belong to the babel7 group definition.

babel7 is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • βœ… ci/circleci: checkout_code: Your tests passed on CircleCI! (Details).
  • ❌ ci/circleci: test: Your tests failed on CircleCI (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Performance: Positions of closed dropdown menus are constantly re-calculated on scroll

I recently noticed that due to the way the dropdown menus of our new accessible menu components are implemented, their positions on the screen are constantly being calculated & updated, even when they're closed.

On most pages this isn't a problem, but in playlists with a lot of assets it could potentially make page scrolling very sluggish, as the position of dozens of hidden menus is being updated.

The cause of this is that for accessibility, the menu containers always need to be present in the DOM. I have implemented this in a less than ideal way, by simply hiding the dropdowns visually, with the popover positioning code still running for them.

The solution is to render the menu containers in the DOM, but "disconnect" them from the usePopover hook when they're not visible. This should be achievable by making some changes to base5-ui's PopoverCard component and how it handles the "closed" state when the renderWhenClosed flag is enabled.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): update dependency @testing-library/react to v14
  • chore(deps): update dependency gh-pages to v5
  • chore(deps): update dependency typescript to v5
  • chore(deps): update storybook monorepo to v7 (major) (@storybook/addon-actions, @storybook/addon-docs, @storybook/addon-essentials, @storybook/addon-links, @storybook/react)
  • fix(deps): update dependency chartist to v1
  • πŸ” Create all rate-limited PRs at once πŸ”

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

circleci
.circleci/config.yml
npm
package.json
  • @popperjs/core ^2.11.5
  • aria-hidden ^1.1.3
  • chartist ^0.11.4
  • classnames ^2.3.1
  • color2k ^2.0.0
  • focus-visible ^5.2.0
  • focusable-selectors ^0.3.1
  • popper-max-size-modifier ^0.2.0
  • react-focus-lock ^2.8.1
  • react-merge-refs ^1.1.0
  • react-popper ^2.2.5
  • use-item-list 0.1.2
  • @babel/core ^7.17.9
  • @babel/preset-env ^7.16.11
  • @babel/preset-react ^7.16.7
  • @babel/preset-typescript ^7.16.7
  • @commitlint/cli ^16.2.3
  • @commitlint/config-conventional ^16.2.1
  • @semantic-release/changelog ^6.0.1
  • @semantic-release/git ^10.0.1
  • @storybook/addon-actions ^6.4.22
  • @storybook/addon-docs ^6.4.22
  • @storybook/addon-essentials ^6.4.22
  • @storybook/addon-links ^6.4.22
  • @storybook/react ^6.4.22
  • @testing-library/jest-dom ^5.16.4
  • @testing-library/react ^12.1.5
  • @testing-library/user-event ^13.5.0
  • @types/jest ^27.4.1
  • @types/styled-components ^5.1.25
  • @typescript-eslint/eslint-plugin 5.22.0
  • @typescript-eslint/parser 5.22.0
  • babel-jest ^27.5.1
  • eslint ^8.13.0
  • eslint-config-5app ^0.16.4
  • eslint-config-prettier ^8.5.0
  • eslint-plugin-import ^2.26.0
  • eslint-plugin-jsx-a11y ^6.5.1
  • eslint-plugin-react ^7.29.4
  • eslint-plugin-react-hooks ^4.4.0
  • eslint-plugin-storybook ^0.5.11
  • gh-pages ^3.2.3
  • husky ^7.0.4
  • jest ^27.5.1
  • pixo ^1.1.2
  • prettier ^2.6.2
  • prop-types ^15.8.1
  • react ^17.0.2
  • react-dom ^17.0.2
  • regenerator-runtime ^0.13.9
  • semantic-release ^19.0.2
  • styled-components ^5.3.5
  • typescript ^4.6.3
  • react ^17.0.2
  • react-dom ^17.0.2
  • styled-components ^5.3.5

  • Check this box to trigger a request for Renovate to run again on this repository

Modal: Don't close on Escape keypress when it's handled by nested UI components

We need to add a way for UI components to prevent their own Escape key functionality from conflicting with that of the Modal component. Currently, pressing the Escape key to close e.g. a Select menu that lives within a modal will also close the modal, which is unexpected and frustrating to users.

The easiest way to achieve this would probably be to change global useEventListener hooks to regular onKeyDown props on wrapper components, so that the events can be stopped from propagating once they've been handled. Or maybe we just need to declare a more specific targetElement for the useEventListener hooks so they're not global and can be cancelled.

Separate handling may be needed for our generic Popover/Tooltip escape key listener, as it can't rely on a single wrapper element and needs to be global.

Investigate intermittent "TypeError: Cannot read property 'createEvent' of null" during tests

Sometimes the following error occurs while running tests, both locally and remotely.

TypeError: Cannot read property 'createEvent' of null
    at Object.invokeGuardedCallbackDev (/home/circleci/repo/node_modules/react-dom/cjs/react-dom.development.js:3905:26)
    at invokeGuardedCallback (/home/circleci/repo/node_modules/react-dom/cjs/react-dom.development.js:4056:31)
    at flushPassiveEffectsImpl (/home/circleci/repo/node_modules/react-dom/cjs/react-dom.development.js:23543:11)
    at unstable_runWithPriority (/home/circleci/repo/node_modules/scheduler/cjs/scheduler.development.js:468:12)
    at runWithPriority$1 (/home/circleci/repo/node_modules/react-dom/cjs/react-dom.development.js:11276:10)
    at flushPassiveEffects (/home/circleci/repo/node_modules/react-dom/cjs/react-dom.development.js:23447:14)
    at Object.<anonymous>.flushWork (/home/circleci/repo/node_modules/react-dom/cjs/react-dom-test-utils.development.js:992:10)
    at Immediate.<anonymous> (/home/circleci/repo/node_modules/react-dom/cjs/react-dom-test-utils.development.js:1003:11)
    at processImmediate (internal/timers.js:464:21)
/home/circleci/repo/node_modules/react-dom/cjs/react-dom.development.js:3905
      var evt = document.createEvent('Event');

It's not clear to me why this is happening and what can be done to prevent it. Usually re-running the tests makes them pass without the error.

Add "disabled" state to "Select" component

The Select component should be able to be disabled, for when changing the selected value needs to be prevented.

Need to investigate how to do this in an accessible way; maybe aria-disabled & disabling all menu interactions will be enough?

TextLink: Add styles for disabled state

The TextLink component is built on top of ButtonCore which has an isDisabled prop (depending on whether a real link or a button is rendered, this will either render a <span> instead of a link, or add the aria-disabled attribute to buttons.

We need to add appropriate styling to make this state perceivable by users.

Table: Allow adding a column id separate from the column title

Problem

Currently, the Table component's sort handler returns the name of the column that the sorting was changed on. Since the name of a column currently doubles as its readable title, this name may be a dynamic, localised string, which is inconvenient for the purpose of serving as an identifier when changing column sorting.

Proposed solution

  • Rename current name prop to title, make it isRequired
  • Make the name prop optional and use it as a static identifier that is not exposed in the UI

MenuList/MenuList: Add `Divider` and `GroupLabel` components

To support the new menu structure on the playlist page, we need to add some components to base5-ui.

image

MenuList

Divider

A new MenuList.Divider component. This can probably just be the Divider component with added top and botto margin.

GroupLabel

A new GroupLabel component with dimmed text and very small bold text (I think it's fontSize="xxs").

Menu

With the MenuList changes in place, we can use them to add more structure to the Menu component.

https://www.w3.org/TR/wai-aria-practices-1.2/#menu

Divider (or MenuItemDivider?)

A MenuList.Divider component with role="separator"

MenuItemGroup

This should be a combination of 2 elements:

  • A wrapper element with role="group" which is aria-labelledby the next element:
  • A GroupLabel component

The intended usage should look something like this:

<MenuList>
  <MenuItemGroup label="Birds">
    <MenuItem>
      Blue-footed booby
    </MenuItem>
    <MenuItem>
      Hungry pelican
    </MenuItem>
  </MenuItemGroup>
  <Divider />
  <MenuItemGroup label="Crocodiles">
    <MenuItem>
      Just a crocodile
    </MenuItem>
</MenuList>

An in-range update of babel7 is breaking the build 🚨

There have been updates to the babel7 monorepo:

    • The devDependency @babel/cli was updated from 7.4.4 to 7.5.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

This monorepo update includes releases of one or more dependencies which all belong to the babel7 group definition.

babel7 is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • βœ… ci/circleci: checkout_code: Your tests passed on CircleCI! (Details).
  • ❌ ci/circleci: test: Your tests failed on CircleCI (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of eslint-config-5app is breaking the build 🚨

The devDependency eslint-config-5app was updated from 0.7.4 to 0.7.5.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

eslint-config-5app is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • βœ… ci/circleci: checkout_code: Your tests passed on CircleCI! (Details).
  • ❌ ci/circleci: test: Your tests failed on CircleCI (Details).

Release Notes for v0.7.5

0.7.5 (2019-10-11)

Bug Fixes

  • deps: update dependency eslint-plugin-you-dont-need-lodash-underscore to v6.7.1 (c38fb36)
Commits

The new version differs by 2 commits.

  • dc266c4 chore(release): 0.7.5 [skip ci]
  • c38fb36 fix(deps): update dependency eslint-plugin-you-dont-need-lodash-underscore to v6.7.1

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

usePopoverState: Built-in option for closing popover on Esc keypress

Popovers must be dismissible via the Esc key, this should be built into the usePopoverState hook, possibly through combining it with the useEventListener hook. An initial implementation of this was buggy & I worked around it using the DocumentClickListener component, but a hook-only solution would be preferable. useEventListener probably needs a proper way to disable it.

Icon component: Support margin and theming style props

The Icon component currently only supports the non-standard spacingLeft and spacingRight props instead of the commonly used ml, mr, mx, etc style props. Additionally, the color prop is not theme-aware yet, i.e. it only supports raw HTML colours instead of theme colour identifiers like "text", "links" or "highlight".

Theming: Improve color blocks and theme section defaults

Some aspects of our theming system could use some streamlining to make it both easier to use and more flexible.

Issues:

  1. Button colours are currently global and separate from both Theme Sections and Color Blocks. They're simpler than a Theme Section, and slightly more complex than a Color Block (giving separate control over text and background colour). In a way, they're an escape hatch I introduced because neither concept was fitting 100%.
  2. Neither Color Blocks nor Buttons can be customised per Theme Section. Since Buttons are global, they may clash with some of the colours set for a theme section. Ironically, the negative example in the Storybook theming explainer can still easily happen in base5-ui. There needs to be a theme-level escape hatch for that.
  3. Theme Sections often share similar variables. Especially the fields links, highlight, textDimStrength, shadeStrength, and lineStrength are often the same across multiple Theme Sections.

Approach:

  • Allow specifying a default Theme Section sections.default which will be extended when variables are missing from any other section
  • Move default Color Blocks from globals.colorBlocks into sections.default.colorBlocks; then allow overriding them in other sections
  • Allow defining Color Blocks in more detail. Currently, they extend a Theme Section named colorBlock, replacing its text, links, and background fields, without precise control over how that's done. It should be possible to instead of assigning a simple colour string, assign an object that overrides the default Theme Section (e.g. instead of positive: 'green', allow positive: {text: '#fff', background: 'green'}). Again, missing fields would be taken from the default.
  • With the aforementioned update, buttons could then be turned from special global variables to simple Color Blocks, e.g. button-default, button-primary, and button-important.

Implementation:

  • All of this needs to be done in a backwards-compatible way, we can't break existing themes
  • Investigate whether the colorBlock section we're currently using is still necessary when we introduce a default Theme Section The colorBlock section has been removed in the meantime βœ…

An in-range update of docz is breaking the build 🚨

The devDependency docz was updated from 2.0.0-rc.77 to 2.0.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

docz is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • βœ… ci/circleci: checkout_code: Your tests passed on CircleCI! (Details).
  • ❌ ci/circleci: test: Your tests failed on CircleCI (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Create new Card component

We're currently using two different Card components in the dashboard repo: ui/elements/Card and ui/elements/Card/legacy ("LegacyCard").

These should be replaced by a single, lower-level Card component that can handle all necessary use cases. The component should be built on top of Box.

Changes:

  • The distinction between "panels" and "cards" should be removed, instead the border radius should be controllable per card, and theme sections might gain a new optional backgroundAlt property for alternating background colours when Cards are nested.
  • One important change will have to be the "inverted" colour mode, which shouldn't be hard-coded the way it currently is in LegacyCard, but should be a new theme section instead (it can be added to the 5app theme and all other themes will inherit it). This will make sure that links and other elements placed in an inverted card will be readable.
  • The margin declarations that are added to the current Card component when a maxWidth is defined should be removed, they'll be able to be added on a case-by-case basis

Create custom radio button component

Our design system is currently missing a RadioButton component that blends in with the theme of the site in the same way our Checkbox component does.

We should create one that works just the same:

  • API should mirror the native <input type="radio" />
  • Like Checkbox, it should have an additional scale prop with the same behaviour
  • Its size & layout properties should match that of the Checkbox component as well, so they can be swapped out for each other seamlessly
  • It's design should follow the default mac OS radio buttons, and the size & colours of the Checkbox component:
    • A simple outlined circle when unselected
    • A filled in circle when selected (theme.links colour), and instead of a checkmark icon, a smaller, white outlined circle in the center
    • Cross-hatched filling when disabled (though it may make sense to revisit this design in both the Checkbox component and here – maybe a simple grey filling is a better look)
    • Thick focus indicator outline (theme.links colour) when using a keyboard

Example of default mac OS checkbox design:
image

BackLinkProvider: Find a solution for pages with many potential parents

Our BackLinkProvider component currently only supports absolute backlink levels, i.e. any given URL path has one fixed backlink level. This can be an issue for pages that have many potential "parent" pages, e.g. the hub's asset viewer.

We're working around this issue for the asset viewer by dynamically offsetting its backlink level by 1 and leaving a matching gap between all other levels, but that's quite hacky.

As playlists can also be opened from many places now (which can have a higher backlink level than the one for the playlist page!), we're running into the same issue again: https://github.com/5app/hub/issues/10937

So we'll need to find a way to solve this globally and without temporary hacks.

A potential solution may be introducing relative offsets for pages, to basically tell the back link provider that a given page is always to be "nested" below the previous level. This could be achieved for example by prefixing a level with a . dot.

In the case of the hub, the playlist page would then get a level of '.1', and the asset viewer a level of '.2'. Even deeper 'nesting' would be indicated by more dots, e.g. '..1'.

I need to spend a bit more time figuring out how this approach affects sibling pages, e.g. when navigating between subpages of the playlist page.

An in-range update of eslint-config-5app is breaking the build 🚨

The devDependency eslint-config-5app was updated from 0.7.1 to 0.7.2.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

eslint-config-5app is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ ci/circleci: checkout_code: CircleCI is running your tests (Details).
  • ❌ ci/circleci: test: Your tests failed on CircleCI (Details).

Release Notes for v0.7.2

0.7.2 (2019-10-09)

Bug Fixes

  • ci: breaking builds on Node12... hopeful fix (6df1a0f)
Commits

The new version differs by 6 commits.

  • cf56437 chore(release): 0.7.2 [skip ci]
  • 6df1a0f fix(ci): breaking builds on Node12... hopeful fix
  • 7218884 Merge pull request #34 from 5app/greenkeeper/eslint-plugin-jsdoc-15.10.0
  • 3506284 chore(package): update eslint-plugin-jsdoc to version 15.10.0
  • 6204278 Merge pull request #33 from 5app/greenkeeper/eslint-plugin-jsdoc-15.9.3
  • 7718ae5 chore(package): update eslint-plugin-jsdoc to version 15.9.3

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.