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

feat(Input): migrate to new design #1248

Merged
merged 19 commits into from
Sep 10, 2024

Conversation

AnastasiiaMP
Copy link
Contributor

@AnastasiiaMP AnastasiiaMP commented Sep 4, 2024

ONEUI-455

BREAKING CHANGE: Input component props size, context, and additional states are updated

  • size prop options are limited to small or medium, with medium as the default. The options large and normal have been removed. Replace size="large" or omitting size (previously defaulting to normal) with size="medium", or use size="small" as needed.
  • context prop only accepts critical. Other contexts like brand or success are removed. For critical contexts, use context="critical" and provide an errorMessage.
  • new readOnly prop added to specify if the input field should be non-editable. Replace any custom methods for setting inputs as non-editable with readOnly={true}.
  • new reserveErrorMessageSpace prop added determine whether space should be reserved for error messages under the input field when validation is expected to avoid "jumping" UI. Default to false.

Checklist

  • The implementation has been manually tested and complies with Textkernel browser support guidelines
  • The implementation complies with accessibility standards.
  • The component has a displayName defined.
  • The component comes with a detailed PropTypes (and defaultProps) definition.
  • Component PropTypes are sufficiently described / documented.
  • There is a story in Storybook.

Copy link

vercel bot commented Sep 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
oneui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 10, 2024 2:51pm

@eszthoff
Copy link
Contributor

eszthoff commented Sep 5, 2024

Please add comment to the PR about breaking changes. Those then should be copied to the commit message when the branch is merged, so that semver correctly tags the next release and change logs are updates as needed. See CONTRIBUTING.md for details

@AnastasiiaMP
Copy link
Contributor Author

@eszthoff I've added breaking changes, please, have a look and let me know if you have any questions. Thank you!

@AnastasiiaMP AnastasiiaMP force-pushed the ONEUI-455-migrate-input-component branch from d037908 to ad800ec Compare September 10, 2024 14:50
@AnastasiiaMP AnastasiiaMP merged commit ce33125 into master Sep 10, 2024
8 checks passed
@AnastasiiaMP AnastasiiaMP deleted the ONEUI-455-migrate-input-component branch September 10, 2024 14:56
@AnastasiiaMP AnastasiiaMP restored the ONEUI-455-migrate-input-component branch September 10, 2024 15:26
@AnastasiiaMP AnastasiiaMP deleted the ONEUI-455-migrate-input-component branch September 10, 2024 15:31
AnastasiiaMP added a commit that referenced this pull request Sep 10, 2024
* feat: migrate input component to new design

* chore: make error message obligatory when context is critical

* fix: remove optional sign from context prop

* refactor: change the naming

* chore: add extra check for error message

* fix: make label optional

* fix: address review comments

* chore: add possibility to unselect the context in storybook

* style: remove focus state from critical context

* refactor: change type for the context

* chore: add possibility to use custom id

* fix: remove unnesasary comment

* refactor: remove isActive state

* chore: add space to the error message

* style: put old naming back

* refactor: make naming more understandable

* refactor: avoid nested tenantry

* refactor: better solution for nested tenantry

* fix avoid jumping width/content on focus and critical

---------

Co-authored-by: Anastasiia Mishchenko <[email protected]>
AnastasiiaMP added a commit that referenced this pull request Sep 10, 2024
BREAKING CHANGE: `size` prop is limited to `small` or `medium`, with `medium` as the default, replace size="large" or omitting size (previously defaulting to `normal`) with size="medium", or use size="small" as needed

BREAKING CHANGE: `context` prop only accepts `critical`. Remove any usage of `brand` or `success` context. Provide `errorMessage` if critical context is expected

BREAKING CHANGE: replace any custom methods for setting inputs as non-editable with new prop `readOnly`

BREAKING CHANGE: replace existing approaches for displaying helper text with the new `helperText` prop

BREAKING CHANGE: use the `label` prop for input labels, replacing any previous label handling

BREAKING CHANGE: use the `reserveErrorMessageSpace` prop to determine whether space should be reserved for error message under the input field when validation is expected, especially if no helper text is present
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.

2 participants