Skip to content
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

docs: add example password Input with show/hide togle #753

Merged
merged 4 commits into from
Oct 2, 2020
Merged

docs: add example password Input with show/hide togle #753

merged 4 commits into from
Oct 2, 2020

Conversation

mattrothenberg
Copy link
Contributor

Adds a Storybook example from the conversation in #626 and #664.

Screenshots

reakit-input

I know requiring Tailwind via CDN isn't ideal, but it was the path of least resistance to getting this example together. I'm happy to add a test, too, if that's required for all examples!

@codesandbox-ci
Copy link

codesandbox-ci bot commented Oct 1, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 4a3677b:

Sandbox Source
Reakit Configuration

@ariakit-bot
Copy link

ariakit-bot commented Oct 1, 2020

Deploy preview for reakit ready!

Built with commit 4a3677b

https://deploy-preview-753--reakit.netlify.app

@diegohaz
Copy link
Member

diegohaz commented Oct 1, 2020

Thanks, @mattrothenberg! That's cool! ❤️

I guess Tailwind CDN is "okay". If it gets more commonly used across examples we can look into adding that directly to the Storybook config and reduce the Storybook bundle size.

Could you please add some tests?

@codecov
Copy link

codecov bot commented Oct 2, 2020

Codecov Report

Merging #753 into master will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #753      +/-   ##
==========================================
+ Coverage   95.63%   95.67%   +0.03%     
==========================================
  Files         185      188       +3     
  Lines        2976     2980       +4     
  Branches      794      793       -1     
==========================================
+ Hits         2846     2851       +5     
+ Misses        130      129       -1     
Impacted Files Coverage Δ
packages/reakit/src/Button/Button.ts 87.50% <ø> (ø)
packages/reakit/src/Popover/PopoverState.ts 75.47% <ø> (ø)
packages/reakit/src/Tooltip/Tooltip.tsx 95.00% <ø> (ø)
...akit/src/Button/__examples__/ButtonAsDiv/index.tsx 100.00% <100.00%> (ø)
...kit/src/Button/__examples__/ButtonAsLink/index.tsx 100.00% <100.00%> (ø)
...rc/Button/__examples__/ButtonWithTooltip/index.tsx 100.00% <100.00%> (ø)
...put/__examples__/InputWithPasswordToggle/index.tsx 100.00% <100.00%> (ø)
... and 1 more

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 53bd816...4a3677b. Read the comment docs.

Copy link
Member

@diegohaz diegohaz left a comment

Choose a reason for hiding this comment

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

Thanks for working on this @mattrothenberg!

I've added the example folder that was missing and refactored the tests.

I'll go ahead and merge it, but I'd appreciate a review on my changes.

@diegohaz diegohaz merged commit c883008 into ariakit:master Oct 2, 2020

const handleToggle = () => {
setInputType((prevInputType) =>
prevInputType === "password" ? "text" : "password"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Much better change, good idea!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: A "password" field with option to hide and show password input
3 participants