Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dropdown/select: when there is no placeholder or value, label will have default font-size #168

Merged
merged 9 commits into from
Jan 10, 2025

Conversation

sun-mota
Copy link
Contributor

@sun-mota sun-mota commented Jan 6, 2025

Alaska Airlines Pull Request

  1. dropdown's label font-size will be default when there is no placeholder or value text in trigger
  2. change select's placeholder type to slot from attribute
  3. remove unnecessary padding on trigger text (menuoption)

closes #36

Before Submitting this pull request:

  • Link all tickets in this repository related to this PR in the Development section
    note: all pull requests require at least one linked ticket
  • If this PR is Ready For Review, all ticket's linked under Development must have their status changed to Ready For Review as well

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

New Features:

  • Allow developers to customize the placeholder content of the <auro-select> component using a named slot.

@sun-mota sun-mota self-assigned this Jan 6, 2025
@sun-mota sun-mota changed the base branch from main to beta January 6, 2025 21:04
@AlaskaAirlines AlaskaAirlines deleted a comment from CLAassistant Jan 6, 2025
@AlaskaAirlines AlaskaAirlines deleted a comment from sourcery-ai bot Jan 6, 2025
@sun-mota sun-mota force-pushed the sunMota/label-no-placeholder/36 branch from 5d1b6e9 to 1c7addc Compare January 7, 2025 19:53
@sun-mota sun-mota changed the title dropdown/select: when there is no placeholder, label will have default font-size dropdown/select: when there is no placeholder or value, label will have default font-size Jan 7, 2025
@sun-mota
Copy link
Contributor Author

sun-mota commented Jan 7, 2025

@sourcery-ai review

@sun-mota sun-mota marked this pull request as ready for review January 7, 2025 21:43
@sun-mota sun-mota requested a review from a team as a code owner January 7, 2025 21:43
Copy link

sourcery-ai bot commented Jan 7, 2025

Reviewer's Guide by Sourcery

This PR updates the Auro Select component to improve accessibility and styling by changing how placeholders are handled and removing unnecessary padding.

Class diagram showing changes to AuroSelect component

classDiagram
    class AuroSelect {
        -optionSelected: Object
        -validity: undefined
        -value: String
        +updateDisplayedValue()
        +reset()
        +requestUpdate()
    }
    note for AuroSelect "Removed placeholder property
Moved to slot-based placeholder"

    class AuroDropdown {
        -_hasTriggerContent: Boolean
        -triggerContentSlot: undefined
        +hasTriggerContent: Boolean
        +handleTriggerContentSlotChange()
    }
    note for AuroDropdown "Added trigger content tracking"

    AuroSelect --> AuroDropdown: uses
Loading

File-Level Changes

Change Details Files
Placeholder Implementation
  • Changed the placeholder implementation to use a slot instead of an attribute.
  • Updated documentation and examples to reflect the change in placeholder implementation.
  • Added a placeholder slot to the component to allow for custom placeholder content.
  • Updated the component to handle the placeholder slot and display it correctly.
  • Removed the placeholder attribute from the component and documentation.
  • Updated tests to reflect the change in placeholder implementation.
components/select/src/auro-select.js
components/select/demo/api.md
components/select/docs/api.md
components/select/apiExamples/customPlaceholder.html
components/select/apiExamples/labelWithPlaceholder.html
Dropdown Label Font Size
  • The Auro Dropdown component now dynamically adjusts the label font size based on the presence of trigger content.
  • Added a property to track whether the trigger has content.
  • Added styles to adjust the font size of the label when the trigger is empty.
  • Updated the dropdown to handle changes in the trigger content and update the label font size accordingly.
  • Updated tests to reflect the change in label font size handling.
components/select/src/styles/style.scss
components/dropdown/src/styles/style.scss
components/dropdown/src/auro-dropdown.js
Menuoption Padding
  • Removed unnecessary padding on the trigger text (menuoption).
components/select/src/styles/style.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 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

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @sun-mota - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟡 Complexity: 1 issue found
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

components/dropdown/src/auro-dropdown.js Outdated Show resolved Hide resolved
components/select/demo/api.md Outdated Show resolved Hide resolved
components/dropdown/src/auro-dropdown.js Outdated Show resolved Hide resolved
@sun-mota sun-mota linked an issue Jan 7, 2025 that may be closed by this pull request
@sun-mota sun-mota force-pushed the sunMota/label-no-placeholder/36 branch from 0914096 to 9625bf5 Compare January 8, 2025 22:27
Copy link
Contributor

@jordanjones243 jordanjones243 left a comment

Choose a reason for hiding this comment

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

You need to add BREAKING CHANGE commentary to this commit, as now users will have to manually add their own placeholder to continue to get the existing functionality

components/select/apiExamples/labelWithPlaceholder.html Outdated Show resolved Hide resolved
@sun-mota sun-mota force-pushed the sunMota/label-no-placeholder/36 branch from 237f923 to da4f06c Compare January 9, 2025 19:07
@sun-mota sun-mota force-pushed the sunMota/label-no-placeholder/36 branch from 462eeb6 to 9768ebe Compare January 9, 2025 20:48
@sun-mota sun-mota force-pushed the sunMota/label-no-placeholder/36 branch from 9768ebe to 0ae0b38 Compare January 10, 2025 17:25
@sun-mota sun-mota force-pushed the sunMota/label-no-placeholder/36 branch from 0ae0b38 to d105eb5 Compare January 10, 2025 17:28
@jordanjones243 jordanjones243 force-pushed the sunMota/label-no-placeholder/36 branch from 4e003dd to c665588 Compare January 10, 2025 17:49
@sun-mota sun-mota merged commit b47460b into beta Jan 10, 2025
3 checks passed
@sun-mota sun-mota deleted the sunMota/label-no-placeholder/36 branch January 10, 2025 17:54
@jason-capsule42
Copy link
Member

🎉 This PR is included in version 2.0.0-beta.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

auro-select label doesn't move up when value is selected
3 participants