-
Notifications
You must be signed in to change notification settings - Fork 59
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
fix: Step Input #986
fix: Step Input #986
Conversation
Deploy preview for fundamental-styles ready! Built with commit 456ce56 |
Can you create a storybook instead of njk visual tests? |
docs/pages/components/step-input.md
Outdated
folder: components | ||
--- | ||
|
||
The Step Input component is an opinionated composition of the Input, Button components. |
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.
Can we use the description from the Fiori Guidelines? I think it sounds better. I also included the usage guidelines in case you want to add them.
The step input control allows the user to change the input values in predefined increments (steps).
Usage
Use the step input if:
The user needs to adjust amounts, quantities, or other values quickly.
The user needs to adjust values for a specific step (for example, in a shopping cart).
Do not use the step input if:
The user needs to enter a static number (for example, postal code, phone number, or ID). In this case, use the regular input field control instead.
You want to display a value that rarely needs to be adjusted and does not pertain to a particular step. In this case, use the regular input field control instead.
You want the user to enter dates and times. In this case, use the date picker, date range selection, time picker, or date/time picker instead.
docs/pages/components/step-input.md
Outdated
|
||
|
||
## Step Input with Cozy | ||
Cozy Mode is the default one, it should be used in mobile and tablet devices. |
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.
On smartphones and tablets, the step input is shown in cozy mode (default).
docs/pages/components/step-input.md
Outdated
|
||
|
||
## Compact Step Input | ||
Step Input can be used in compact mode, which is done to be used in desktop, or larger screen devices. |
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 Step Input should be used in compact mode when using a desktop of devices with large screens. It can be achieved by adding the --compact
modifier to the main element as well as the button and input elements.
docs/pages/components/step-input.md
Outdated
{% include display-component.html component=step-input-compact %} | ||
|
||
## Step Input with Different states | ||
Step Input Component also supports semantic states, same as for every form. They can be achieved by adding |
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 Step Input component also supports semantic states as does every form. The semantic states can be customized by adding the is-error
| is-success
| is-warning
| or is-information
into the fd-step-input
element.
For now both are added |
fb9f54d
to
b9fbf45
Compare
src/step-input.scss
Outdated
$fd-step-input-compact-button-width: 1.5rem; | ||
$fd-step-input-description-padding: 0.5rem; | ||
|
||
@mixin iconSize($size) { |
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.
Is it worth to create a mixin if its used only once?
src/step-input.scss
Outdated
border-color: var(--sapField_BorderColor); | ||
border-radius: var(--sapField_BorderCornerRadius); | ||
background-color: var(--sapField_Background); | ||
height: calc(#{$fd-step-input-cozy-height} + 2 * var(--sapField_BorderWidth)); |
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.
I don't know if this is correct because there is no exact value in spec, but our standard input height is 36px
and step-input height is 38px
.
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.
You are right, there should be 36px
with borders included (34px + 2px)
src/step-input.scss
Outdated
@include fd-focus() { | ||
outline: none; | ||
|
||
&, |
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.
Shouldn't you use @include fd-hover()
here?
} | ||
|
||
/** Width is different due to different border width */ | ||
&.is-information, |
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.
Missing success
state
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.
success has 1px
from mixin
src/step-input.scss
Outdated
&.is-error, | ||
&.is-warning { | ||
.#{$block}__button.#{$fd-namespace}-button { | ||
width: calc(#{$fd-step-input-cozy-button-width} - 0.125rem); |
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 should move 0.125rem
to a variable
All changes are addressed, it's ready to be reviewed again |
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.
LGTM
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.
can we just have --no-number-spinner
be default behavior for our number type inputs so no extra class is needed?
We decided to have it in other PR |
It think it is because of the Fiori 3 spec, but the focus ring is not visible on the individual step up and step down buttons as seen in the patterns example. I can see this becoming an accessibility issue. |
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 great!
Correction: It is okay that the focus ring is not appearing on the step buttons. This is in line with the But we should also make sure that the buttons inside the input are not tab-able. Currently there is an invisible tab stop. As seen in the above GIF. |
@prsdthkr Thanks for pointing it, I will add |
d51059d
to
456ce56
Compare
Related Issue
fixes: #779
Description
Screenshots
Before:
After: