Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

docs(Accessibility): Display available behaviors for component#510

Merged
jurokapsiar merged 9 commits intomasterfrom
docs/available-behaviors
Dec 7, 2018
Merged

docs(Accessibility): Display available behaviors for component#510
jurokapsiar merged 9 commits intomasterfrom
docs/available-behaviors

Conversation

@jurokapsiar
Copy link
Contributor

@jurokapsiar jurokapsiar commented Nov 21, 2018

Display available behaviors for component.

Available behaviors can be specified using @available tag in the accessibility prop comment:

  /**
   * Accessibility behavior if overridden by the user.
   * @default menuBehavior
   * @available toolbarBehavior, tabListBehavior
   * */
  accessibility?: Accessibility

image

The source of truth in this case is by purpose the component, as the plan forward is to separate behaviors to a separate repo. Then, behaviors will not have any knowledge about the components - components will only use the behaviors.

Once the issue with getting the default value using docgen directly will be resolved, we can also change this to use a compiler-checked reference.

Copy link
Member

@layershifter layershifter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My opinion: this is a cool feature, but we should keep these things in docgen task because our docs components will become overcomplicated. We have doctrine, I almost sure that it can do the same more clearly.

This also can cause performance degrades.

@layershifter layershifter added needs author feedback Author's opinion is asked and removed 🚀 ready for review labels Nov 22, 2018
@jurokapsiar jurokapsiar added 🚀 ready for review and removed needs author feedback Author's opinion is asked labels Nov 22, 2018
@codecov
Copy link

codecov bot commented Nov 22, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@2411cad). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #510   +/-   ##
=========================================
  Coverage          ?   88.17%           
=========================================
  Files             ?       42           
  Lines             ?     1455           
  Branches          ?      212           
=========================================
  Hits              ?     1283           
  Misses            ?      167           
  Partials          ?        5
Impacted Files Coverage Δ
src/components/Menu/MenuItem.tsx 80.48% <ø> (ø)
src/components/Grid/Grid.tsx 100% <ø> (ø)
src/components/Menu/Menu.tsx 100% <ø> (ø)
src/components/Popup/Popup.tsx 30.09% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2411cad...5dea762. Read the comment docs.

@jurokapsiar jurokapsiar merged commit 7323a94 into master Dec 7, 2018
@jurokapsiar jurokapsiar deleted the docs/available-behaviors branch December 7, 2018 15:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants