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

feat(Input): adding fluid variation #59

Merged
merged 4 commits into from
Aug 8, 2018

Conversation

alinais
Copy link
Contributor

@alinais alinais commented Aug 8, 2018

Input

An input can have the full length of the parent element

TODO

  • Conformance test
  • Minimal doc site example
  • Stardust base theme
  • Teams Light theme
  • Teams Dark theme
  • Teams Contrast theme
  • Confirm RTL usage
  • W3 accessibility check
  • Stardust accessibility check
  • Update glossary props table
  • Update the CHANGELOG.md

API Proposal

Fluid

An input component can take the full width of the parent element.
image

<Input fluid icon="search" placeholder="Search..." />

@codecov
Copy link

codecov bot commented Aug 8, 2018

Codecov Report

Merging #59 into master will increase coverage by 1.06%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #59      +/-   ##
==========================================
+ Coverage   85.88%   86.94%   +1.06%     
==========================================
  Files          74       75       +1     
  Lines        1098     1180      +82     
  Branches      215      216       +1     
==========================================
+ Hits          943     1026      +83     
+ Misses        149      148       -1     
  Partials        6        6
Impacted Files Coverage Δ
src/components/Input/Input.tsx 78% <100%> (ø) ⬆️
src/components/Input/inputRules.ts 100% <100%> (ø)
src/components/List/List.tsx 100% <0%> (ø) ⬆️
src/themes/teams/components/Header/headerStyles.ts
src/themes/teams/components/Input/inputStyles.ts
...teams/components/Header/headerDescriptionStyles.ts
.../components/Accordion/accordionContentVariables.ts
src/themes/teams/components/Menu/menuStyles.ts
...rc/themes/teams/components/Image/imageVariables.ts
src/themes/teams/components/Text/textVariables.ts
... and 62 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 5b72d95...d6c6c11. Read the comment docs.

CHANGELOG.md Outdated
@@ -26,7 +26,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
### Features
- Update styles for Menu underlined primary @miroslavstastny ([#20](https://github.com/stardust-ui/react/pull/20))
- Add Avatar `getInitials` prop and `presenceIndicatorBackground` variable @mnajdova ([#38](https://github.com/stardust-ui/react/pull/38))
- Add 'fluid' variant and size variables to Image @kuzhelov ([#54](https://github.com/stardust-ui/react/pull/54))
- Add `fluid` variant and size variables to Image @kuzhelov ([#54](https://github.com/stardust-ui/react/pull/54))
Copy link
Contributor

Choose a reason for hiding this comment

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

thanks :)

@@ -14,6 +14,8 @@ export default (siteVars: any) => {
vars.inputPadding = `${pxToRem(6)} ${pxToRem(24)} ${pxToRem(6)} ${pxToRem(12)}`
vars.inputFocusBorderColor = siteVars.brand
vars.inputFocusBorderRadius = `${pxToRem(3)} ${pxToRem(3)} ${pxToRem(2)} ${pxToRem(2)}`
vars.inputMaxWidth = '100%'
Copy link
Contributor

Choose a reason for hiding this comment

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

probably, at this point it is not necessary to introduce these customization mechanisms - at least maxWidth seems to be an overkill with width property being set to the same value. Also, if we would like to introduce width variable, we should keep in mind that it is a more specific setting, so it should win fluent prop setting for the following case:

<Input fluid /> { /* width is 100% */ }
<Input fluid variables={{ width: '50px' }} />  { /* width should be 50px, as 'variables' is more specific setting */ }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixing it by reducing the possibility to modify the width of the input tag from variables

return {
display: 'inline-flex',
position: 'relative',
alignItems: 'center',
justifyContent: 'flex-end',
outline: 0,
...(fluid && {
width: '100%',
maxWidth: '100%',
Copy link
Contributor

Choose a reason for hiding this comment

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

why we need to set maxWidth in addition?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removing it; not needed

@alinais alinais force-pushed the feature/input-fluid-variation branch from e23bcad to 2220834 Compare August 8, 2018 17:36
@kuzhelov kuzhelov merged commit 5e83722 into master Aug 8, 2018
@kuzhelov kuzhelov deleted the feature/input-fluid-variation branch August 8, 2018 19:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants