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 menu #28 #34

Closed sun-mota closed 6 days ago

sun-mota commented 2 weeks ago

Alaska Airlines Pull Request

close #28

adding auro-menu@4.1.4 to auro-formkit

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 'auro-menu' component to the project, complete with build scripts, documentation, and tests to support its integration and usage.

New Features:

Enhancements:

Documentation:

Tests:

sourcery-ai[bot] commented 2 weeks ago

Reviewer's Guide by Sourcery

This PR adds the auro-menu component to the project, including its implementation, build scripts, documentation, and tests. The menu component provides users with a list of selectable options and supports features like nested menus, disabled states, keyboard navigation, and custom events.

Class diagram for the new auro-menu component

classDiagram
    class AuroMenu {
        -String value
        -Object optionSelected
        -String matchWord
        -Boolean noCheckmark
        -Boolean ready
        -Object optionActive
        -Boolean rootMenu
        -AuroLibraryRuntimeUtils runtimeUtils
        -String nestingSpacer
        +resetOptionsStates()
        +makeSelection()
        +selectNextItem(String moveDirection)
        +selectByValue(String value)
        +updateActiveOption(int index)
        +handleSlotItems()
        +notifyReady()
    }

    class AuroMenuOption {
        -Boolean nocheckmark
        -Boolean disabled
        -Boolean selected
        -String value
        -Number tabIndex
        -AuroLibraryRuntimeUtils runtimeUtils
        +generateIconHtml(String svgContent)
    }

    AuroMenu --> AuroMenuOption : uses
    AuroMenuOption --> AuroIcon : uses
    AuroMenuOption --> AuroLibraryRuntimeUtils : uses
    AuroMenu --> AuroLibraryRuntimeUtils : uses
    AuroMenu --> AuroMenuOption : contains
    AuroMenuOption --> AuroIcon : contains

File-Level Changes

Change Details Files
Add auro-menu and auro-menuoption component implementations
  • Implement menu component with support for keyboard navigation
  • Add support for nested menus and option indentation
  • Implement disabled states and option selection handling
  • Add custom event support and value matching functionality
  • Implement styling for menu states and option highlighting
components/menu/src/auro-menu.js
components/menu/src/auro-menuoption.js
components/menu/src/style-menu.scss
components/menu/src/style-menuoption.scss
components/menu/src/color-menu.scss
components/menu/src/color-menuoption.scss
Add build configuration and scripts for menu component
  • Add build scripts for menu component compilation
  • Add test scripts for menu component
  • Add demo and documentation build scripts
  • Update package.json with menu-related dependencies and scripts
package.json
Add comprehensive documentation and examples
  • Add API documentation with properties, methods and events
  • Add usage examples for different menu configurations
  • Add design specifications and guidelines
  • Include code examples for common use cases
components/menu/docs/api.md
components/menu/demo/api.md
components/menu/docs/partials/description.md
components/menu/docs/partials/useCases.md
components/menu/apiExamples/*.html
Add test suite for menu component
  • Add tests for menu selection functionality
  • Add tests for keyboard navigation
  • Add tests for disabled states and option handling
  • Add tests for custom events
components/menu/test/auro-menu.test.js
Fix input component clear functionality
  • Change value reset from undefined to empty string
  • Add element update wait in clear button test
components/input/src/base-input.js
components/input/test/auro-input.test.js

Assessment against linked issues

Issue Objective Addressed Explanation
#28 Add menu component to the project

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).