-
Notifications
You must be signed in to change notification settings - Fork 832
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding some docs for evergreen's Autocomplete #162
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks awesome! I left some minor feedback on nomenclature.
src/autocomplete/docs/index.js
Outdated
}) | ||
|
||
const title = 'Autocomplete' | ||
const subTitle = 'A component to filter trhough a dataset' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A component to filter through a list of options
src/autocomplete/docs/index.js
Outdated
const title = 'Autocomplete' | ||
const subTitle = 'A component to filter trhough a dataset' | ||
|
||
const introduction = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
introduction => implementationDetails.
introductions should try to use accessible language to both designers and engineers on the long run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can ignore the introduction and just use implementationDetails instead.
src/autocomplete/docs/index.js
Outdated
|
||
const components = [ | ||
{ | ||
name: 'AutoComplete', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Autocomplete
src/autocomplete/docs/index.js
Outdated
|
||
const description = ( | ||
<p> | ||
The <code>AutoComplete</code> component. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Autocomplete component.
src/autocomplete/docs/index.js
Outdated
<div> | ||
<p> | ||
The <code>Autocomplete</code> components implements a{' '} | ||
<code>VirtualList</code> inside a React Portal, list and to be enable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Autocomplete renders a filterable list of options in a Popover — it does not render the text input. If you need a combination with a text input and trigger button, take a look at the Combobox component. This component is mainly used to create type aheads.
The Autocomplete component combines a set of external libraries
- Uses Downshift for autocomplete
- Uses react-tiny-virtual-list for performant list rendering
- Uses fuzzaldrin-plus for fuzzy filtering
src/autocomplete/docs/index.js
Outdated
</div> | ||
) | ||
|
||
const designGuidelines = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can delete this if it's empty
src/autocomplete/docs/index.js
Outdated
scope | ||
}, | ||
{ | ||
title: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
title: 'Fully Featured Example'
description: 'Full width (using flex) example with options, title, onFocus, filtering, and a button to trigger the autocomplete''
src/autocomplete/src/Autocomplete.js
Outdated
children: PropTypes.func.isRequired, | ||
/** | ||
* Proptype to set the lits items size beforehand for the virtual list to render properly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The height of each item. Because the list is virtualized this is required beforehand.
src/autocomplete/src/Autocomplete.js
Outdated
itemSize: PropTypes.number, | ||
/** | ||
* Function that returns a component to render the iist item. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function that returns a component to render the item.
src/autocomplete/src/Autocomplete.js
Outdated
renderItem: PropTypes.func, | ||
/** | ||
* Function used to filter items it should just return a subset of the initial items. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A function that is used to filter the items. It should return a subset of the initial items. By default the "fuzzaldrin-plus" package is used.
Updated comments @jeroenransijn :D |
src/autocomplete/docs/index.js
Outdated
<div> | ||
<p> | ||
The <code>Autocomplete</code> components renders a filterable list of | ||
options in a Popover — it does not render the text input - If you need a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Being a type nazi here. hyphen (-) is not an em dash (—). Please use a em dash in this case. Learn more here: https://practicaltypography.com/hyphens-and-dashes.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that because code editors uses a monospace font, it doesn't look any different in the code editor.
docs/src/utils/getComponent.js
Outdated
'search input': searchInputDocs, | ||
icons: iconsDocs | ||
icons: iconsDocs, | ||
autocomplete: autocompleteDocs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunate merge :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woops :(
@fforres 🥇 👍 🎉 🌲 |
* Adding some docs for evergreen's Autocomplete (#162) * adding eslint for IDE && initial commit * Adding all default exapmples * fix lint * default export * package * marker * Adding some more options * Adding proptypes explanation * fixing textProps * remove children * Adressing comments from @jeroenransijn * adding emdash * Update * Docs corner dialog (#165) * breaking improvements and docs corner dialog * minor copy update * docs and bbreaking improvements (#167) * label change * improvements positioner, popover and tooltip * update Autocomplete and Combobox * improved positioner * improved components
* Docs corner dialog (#165) * breaking improvements and docs corner dialog * minor copy update * docs and bbreaking improvements (#167) * label change * Improves Popover, Positioner, Overlay and Side Sheet (#169) * Adding some docs for evergreen's Autocomplete (#162) * adding eslint for IDE && initial commit * Adding all default exapmples * fix lint * default export * package * marker * Adding some more options * Adding proptypes explanation * fixing textProps * remove children * Adressing comments from @jeroenransijn * adding emdash * Update * Docs corner dialog (#165) * breaking improvements and docs corner dialog * minor copy update * docs and bbreaking improvements (#167) * label change * improvements positioner, popover and tooltip * update Autocomplete and Combobox * improved positioner * improved components * unify system (#168) * Focus support dialog (#170) * improved focus management dialog * focus management docs dialog * tooltip docs (#171) * tooltip docs * improve tooltip + links * combobox docs (#172) * export Position * remove old readmes * Docs radio (breaking change) (#177) * segmented control docs (#176) * radio docs * is required prop * doc text * improved focus handling (#178) * fix rowno comments * added isInvalid back to radio * default position prop tooltip * 3.0.0
* adding eslint for IDE && initial commit * Adding all default exapmples * fix lint * default export * package * marker * Adding some more options * Adding proptypes explanation * fixing textProps * remove children * Adressing comments from @jeroenransijn * adding emdash * Update
* Docs corner dialog (segmentio#165) * breaking improvements and docs corner dialog * minor copy update * docs and bbreaking improvements (segmentio#167) * label change * Improves Popover, Positioner, Overlay and Side Sheet (segmentio#169) * Adding some docs for evergreen's Autocomplete (segmentio#162) * adding eslint for IDE && initial commit * Adding all default exapmples * fix lint * default export * package * marker * Adding some more options * Adding proptypes explanation * fixing textProps * remove children * Adressing comments from @jeroenransijn * adding emdash * Update * Docs corner dialog (segmentio#165) * breaking improvements and docs corner dialog * minor copy update * docs and bbreaking improvements (segmentio#167) * label change * improvements positioner, popover and tooltip * update Autocomplete and Combobox * improved positioner * improved components * unify system (segmentio#168) * Focus support dialog (segmentio#170) * improved focus management dialog * focus management docs dialog * tooltip docs (segmentio#171) * tooltip docs * improve tooltip + links * combobox docs (segmentio#172) * export Position * remove old readmes * Docs radio (breaking change) (segmentio#177) * segmented control docs (segmentio#176) * radio docs * is required prop * doc text * improved focus handling (segmentio#178) * fix rowno comments * added isInvalid back to radio * default position prop tooltip * 3.0.0
TextTableCell
proptextProps
to bePropTypes.shape(Text.propTypes)
instead of aPropTypes.shape(PropTypes.object)