Skip to content

Implement date input component - #126

Merged
gabrieldrn merged 10 commits into
mainfrom
component/simple-date-input
Mar 28, 2026
Merged

gabrieldrn merged 10 commits into
mainfrom
component/simple-date-input

Conversation

@gabrieldrn

Copy link
Copy Markdown
Owner

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:

  • Added the SimpleDateInput composable, 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.
  • Introduced SimpleDateInputState and its implementation, handling date parsing, formatting, validation callbacks, and state restoration via Compose's Saver. Includes a rememberSimpleDateInputState function for lifecycle-aware state management.

Testing:

  • Created SimpleDateInputTest with extensive unit tests for layout, semantics, validation, state restoration, and programmatic updates, ensuring robustness and correct behavior of the new component.

Catalog Integration:

  • Updated imports in DatePickerDemoScreen.kt to include SimpleDateInput and its state, preparing the catalog for a demo of the new component.

Platforms testing checklist

  • Android
  • iOS
  • Desktop
    • Linux
    • Apple
    • Windows
  • WASM

Screenshots / videos

@gabrieldrn gabrieldrn added the component Relates to a component of Carbon label Mar 27, 2026
@gabrieldrn gabrieldrn linked an issue Mar 27, 2026 that may be closed by this pull request
@gabrieldrn
gabrieldrn requested a review from Copilot March 27, 2026 00:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 SimpleDateInput composable plus SimpleDateInputState + rememberSimpleDateInputState.
  • Adds SimpleDateInputTest coverage 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.

Comment thread docs/components/index.md Outdated
Comment thread carbon/src/commonMain/kotlin/com/gabrieldrn/carbon/datepicker/SimpleDateInput.kt Outdated
@gabrieldrn
gabrieldrn merged commit 827eca1 into main Mar 28, 2026
14 checks passed
@gabrieldrn
gabrieldrn deleted the component/simple-date-input branch March 28, 2026 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component Relates to a component of Carbon

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Date Picker - Simple date input variant

2 participants