feat(number-input): matches parity on WC type='text', custom validations, format options#21681
Conversation
✅ Deploy Preview for v11-carbon-react ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #21681 +/- ##
========================================
Coverage 94.89% 94.89%
========================================
Files 539 539
Lines 44549 45102 +553
Branches 6291 6313 +22
========================================
+ Hits 42274 42801 +527
- Misses 2143 2169 +26
Partials 132 132
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
✅ Deploy Preview for v11-carbon-web-components ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
@carbon-design-system/design this needs a design review as mentioned in the issue. |
|
any missing controls are expected to be added in. #20939 |
|
I noticed this pull request is in the merge queue, but it still has a pending visual review label. Is there any remaining work related to that, or should the label be removed? |
right! this needs visual review. as i mentioned before #21681 (comment) edit: also |
Kritvi-bhatia17
left a comment
There was a problem hiding this comment.
Great work @devadula-nandan, just some suggestions from content and visual consistency.
- Can we arrange the stories alphabetically? For example, “With Type of Custom Validation” could come after “With AI Label”, which would also align with the React Storybook ordering. (Screenshot attached for reference)
-
Can we use the same label across all Number Input stories in WC—specifically “NumberInput label”? Currently, it varies across 3–4 stories.
-
Can we update the error message to: “Number is not valid. Must be between -100 and 100.” This should make the error clearer for users and also match the React Storybook.
-
In WC, for the “With AI Label”, “With Type of Text Controlled”, and “With Type of Custom Validation” stories, a lot of props don’t seem to be working for me. I’ve added a screen recording here for reference:
https://github.com/user-attachments/assets/d679e153-8ac9-4d86-b189-3600467e6d53
Once this is fixed, I’ll be able to continue the review.
I still see it used frequently. The docs also indicate that it should be used, as of the latest commit in this pull request: carbon/docs/guides/reviewing-pull-requests.md Lines 83 to 87 in 73be5f7 |
yes. it was repurposed to be just a status. previously it used to trigger some merge automations. |
^ done
^ updated as per suggestion
^ done. this appeared on default story. i updated it as per suggestion.
as mentioned in pr template
and in the comment there is a seperate scope for this to be handled there. the newer stories needs to share same story template that must be working for all stories similar to default story. as part of that issue |
Kritvi-bhatia17
left a comment
There was a problem hiding this comment.
LGTM @devadula-nandan, great work! 🚀
13f2327
…ons, format options (carbon-design-system#21681) * feat: number input type text and custom validations initial commit * fix: ts build errors, and in inheriting fluid number input * chore: comment new tests * fix: add @carbon/utilities as explicit dependency * fix: update lock file * fix: validate on input and controlled set value and tests * chore: update copyright current year * fix: update yarn lock * Update packages/web-components/src/components/number-input/__tests__/number-input-test.js remove test comment Co-authored-by: Mahmoud <132728978+maradwan26@users.noreply.github.com> * fix: few inconsistencies and add tests * chore: add clarity on note * revert: test stories * chore: remove note and update jsdoc * fix: validation logic which are failing tests after merge from main * fix: some edge cases and add tests * revert: test stories, and mark new features as experimental * chore: update utilities to 0.17.0 * fix: modify contradicting test, and fix button disable state in readonly * refactor: add review suggestions, bump test coverage, add story actions * fix: review comments * chore: export re-usable direction type used in event detail * Update number-input.ts Co-authored-by: Adam Alston <aalston9@gmail.com> * docs: update stories --------- Co-authored-by: Mahmoud <132728978+maradwan26@users.noreply.github.com> Co-authored-by: emyarod <emyarod@users.noreply.github.com> Co-authored-by: Adam Alston <aalston9@gmail.com>
Closes #19848, #21663
matches parity on WC number-input with
#19471
#19742
#21135
and
formatOptionsChangelog
New
With Type Of Text,With Type Of Text Controlled,With Type Of Custom Validation. same as react.@internationalized/numbertype,locale,formatOptions,pattern,inputModeGermanlocale option to the switcher in the storybook toolbarNaNvaluesNumber, not the locale-formattedstring. with strict typingonBluris called when the input is blurred, and also when stepper buttons are blurredChanged
Removed
argsto every story #20939Testing / Reviewing
all tests referenced from mentioned pr's were added with patch coverage of 98%.
can also be tested manually by enabling the hidden test story which covers all cases for type="text"
PR Checklist
As the author of this PR, before marking ready for review, confirm you:
- [ ] Addressed any impact on accessibility (a11y)More details can be found in the pull request guide