AlaskaAirlines / auro-drawer

Custom element that displays additional information over page content
https://auro.alaskaair.com/components/auro/drawer
Apache License 2.0
0 stars 0 forks source link

feat(api): add register static method #28 #29

Closed sun-mota closed 4 weeks ago

sun-mota commented 4 weeks ago

Alaska Airlines Pull Request

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Resolves: #28

Summary:

Type of change:

Please delete options that are not relevant.

Checklist:

By submitting this Pull Request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Pull Requests will be evaluated by their quality of update and whether it is consistent with the goals and values of this project. Any submission is to be considered a conversation between the submitter and the maintainers of this project and may require changes to your submission.

Thank you for your submission!
-- Auro Design System Team

Summary by Sourcery

Add a static method 'AuroDrawer.register' to facilitate manual registration of the 'auro-drawer' element, update dependencies, and correct documentation errors.

New Features:

Bug Fixes:

Enhancements:

Documentation:

sourcery-ai[bot] commented 4 weeks ago

Reviewer's Guide by Sourcery

This PR introduces a new static register method to the AuroDrawer component, simplifying the component registration process. The implementation replaces the direct customElements.define call with a more flexible registration approach that allows custom element names. The changes also include documentation updates and bug fixes in examples.

Class diagram for AuroDrawer with new register method

classDiagram
    class AuroDrawer {
        +static register(name="auro-drawer")
    }
    note for AuroDrawer "New static method 'register' added to allow flexible component registration."

File-Level Changes

Change Details Files
Introduced a new static register method for component registration
  • Added static register method with optional name parameter defaulting to 'auro-drawer'
  • Replaced direct customElements.define with AuroLibraryRuntimeUtils registration
  • Removed automatic registration on import
src/auro-drawer.js
Updated documentation and examples to reflect new registration method
  • Updated code examples to use new AuroDrawer.register() method
  • Fixed typo 'clement' to 'element' in documentation
  • Removed references to RuntimeUtils import in examples
  • Updated button and header text in custom drawer example
demo/index.md
docs/partials/index.md
demo/index.html
apiExamples/custom.html
Modified demo initialization and fixed example bugs
  • Added component registration calls in demo initialization
  • Fixed incorrect drawer reference in custom example
  • Added main component import to api.js
demo/index.js
apiExamples/custom.js
demo/api.js
Removed version files
  • Removed buttonVersion.js content
  • Removed iconVersion.js content
src/buttonVersion.js
src/iconVersion.js

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).
jordanjones243 commented 4 weeks ago

:tada: This PR is included in version 2.1.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: