AlaskaAirlines / auro-form

Custom element that ....
https://auro.alaskaair.com/components/auro/form
Apache License 2.0
0 stars 0 forks source link

feat: add checkbox into components #27 #32

Closed sun-mota closed 1 week ago

sun-mota commented 2 weeks ago

Alaska Airlines Pull Request

27

By submitting this Pull Request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I have performed a self-review of my own update.

Summary by Sourcery

Add a new checkbox component to the auro-formkit, update build scripts to support it, and provide detailed documentation and examples.

New Features:

Enhancements:

Documentation:

sourcery-ai[bot] commented 2 weeks ago

Reviewer's Guide by Sourcery

This PR adds a new checkbox component (v4.1.0) to the auro-formkit library. The implementation includes the main checkbox component, checkbox group functionality, and necessary build configurations. The changes primarily focus on adding new component files and updating build scripts to support the checkbox component.

Class diagram for the new checkbox component

classDiagram
    class AuroCheckbox {
        - Boolean checked
        - Boolean disabled
        - Boolean error
        - String id
        - String name
        - String value
        + handleChange(event)
        + handleInput(event)
        + handleFocusin()
        + generateIconHtml()
    }
    class AuroCheckboxGroup {
        - String validity
        - Array value
        - Boolean disabled
        - Boolean required
        - Boolean horizontal
        - AuroFormValidation validation
        - AuroLibraryRuntimeUtils runtimeUtils
        + handleValueUpdate(value, selected)
        + handlePreselectedItems()
        + handleItems()
    }
    AuroCheckboxGroup --> AuroCheckbox : contains
    note for AuroCheckbox "Custom element for selecting options"
    note for AuroCheckboxGroup "Wrapper for AuroCheckbox elements"

File-Level Changes

Change Details Files
Added new checkbox component with group functionality
  • Created auro-checkbox component with basic checkbox functionality
  • Added auro-checkbox-group component for managing multiple checkboxes
  • Implemented support for disabled, error, and required states
  • Added horizontal layout option for checkbox groups
  • Implemented form validation support
components/checkbox/src/auro-checkbox.js
components/checkbox/src/auro-checkbox-group.js
components/checkbox/src/auro-checkbox.scss
components/checkbox/src/auro-checkbox-group.scss
Updated build configuration to support checkbox component
  • Added checkbox-specific build scripts and commands
  • Updated rollup configuration to handle demo bundling
  • Added new npm scripts for building and testing checkbox component
package.json
rollup.config.mjs
Added styling and theming support for checkbox component
  • Created base styles for checkbox appearance and interactions
  • Added support for design tokens and theme customization
  • Implemented error and disabled state styles
components/checkbox/src/color.scss
components/checkbox/src/colorGroup.scss
components/checkbox/src/tokens.scss

Tips and commands #### Interacting with Sourcery - **Trigger a new review:** Comment `@sourcery-ai review` on the pull request. - **Continue discussions:** Reply directly to Sourcery's review comments. - **Generate a GitHub issue from a review comment:** Ask Sourcery to create an issue from a review comment by replying to it. - **Generate a pull request title:** Write `@sourcery-ai` anywhere in the pull request title to generate a title at any time. - **Generate a pull request summary:** Write `@sourcery-ai summary` anywhere in the pull request body to generate a PR summary at any time. You can also use this command to specify where the summary should be inserted. #### Customizing Your Experience Access your [dashboard](https://app.sourcery.ai) to: - Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others. - Change the review language. - Add, remove or edit custom review instructions. - Adjust other review settings. #### Getting Help - [Contact our support team](mailto:support@sourcery.ai) for questions or feedback. - Visit our [documentation](https://docs.sourcery.ai) for detailed guides and information. - Keep in touch with the Sourcery team by following us on [X/Twitter](https://x.com/SourceryAI), [LinkedIn](https://www.linkedin.com/company/sourcery-ai/) or [GitHub](https://github.com/sourcery-ai).