Repository navigation
Implement date input component - #126
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a new text-based date entry component to the Carbon date picker suite, including its state holder, tests, and catalog + docs integration.
Changes:
- Introduces
SimpleDateInputcomposable plusSimpleDateInputState+rememberSimpleDateInputState. - Adds
SimpleDateInputTestcoverage for layout/semantics and state behavior. - Updates the catalog Date Picker demo to showcase the new variant and updates component docs + API dump.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/components/index.md | Adds docs link for the new simple date input. |
| catalog/src/commonMain/kotlin/com/gabrieldrn/carbon/catalog/datepicker/DatePickerDemoScreen.kt | Adds a variant-tab demo showing SimpleDateInput alongside the calendar picker. |
| carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/datepicker/SimpleDateInput.kt | Implements the new SimpleDateInput composable. |
| carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/datepicker/SimpleDateInputState.kt | Adds the state holder + saver + remember... API for parsing/formatting/validation. |
| carbon/src/commonTest/kotlin/com/gabrieldrn/carbon/datepicker/SimpleDateInputTest.kt | Adds tests for layout, semantics, parsing, and programmatic updates. |
| carbon/api/desktop/carbon.api | Updates public API surface for the new component/state. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Notes / Description
This pull request introduces a new "Simple Date Input" component to the Carbon date picker suite, providing a text-based date entry field with validation and formatting support. The implementation includes the main composable, its state management, and comprehensive tests. Additionally, the new component is integrated into the catalog demo screen for demonstration purposes.
New Simple Date Input Component:
SimpleDateInputcomposable, which allows users to type dates directly into a text field, with support for placeholder, helper text, and input state (enabled, error, disabled, read-only). This component delegates parsing and formatting to a state object and provides accessibility semantics.SimpleDateInputStateand its implementation, handling date parsing, formatting, validation callbacks, and state restoration via Compose'sSaver. Includes arememberSimpleDateInputStatefunction for lifecycle-aware state management.Testing:
SimpleDateInputTestwith extensive unit tests for layout, semantics, validation, state restoration, and programmatic updates, ensuring robustness and correct behavior of the new component.Catalog Integration:
DatePickerDemoScreen.ktto includeSimpleDateInputand its state, preparing the catalog for a demo of the new component.Platforms testing checklist
Screenshots / videos