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

Input, select + other form component updates [Rebased] #34

Merged
merged 21 commits into from
Mar 14, 2024

Conversation

slhinyc
Copy link

@slhinyc slhinyc commented Mar 13, 2024

👉 Review app


  • Rebased version of this approved PR
  • Added a prettier formatting commit here
  • Plus a small text update to contributing.md based on comment from other PR
  • Added all the changes from the PR to changelog.md

Changes in this PR

Input

  • Add label-tooltip and context-note slots and attributes
  • Add new type currency with default prefix and suffix elements
  • Add default prefix icon options to types email, tel, and search
  • Update documentation examples to call out or hide unused patterns (pill, filled, size small)
  • Add icon & usage guidelines
  • Moved styles from overrides.css into component styles.ts file
  • Minor styling updates

Textarea

  • Add label-tooltip and context-note slots and attributes
  • Update documentation examples to call out or hide unused patterns (filled, sizes small, large)
  • Moved styles from overrides.css into component styles.ts file
  • Minor styling updates

Select

  • Add label-tooltip and context-note slots and attributes
  • Update documentation examples to call out or hide unused patterns (pill, filled, size small)
  • Add icon & usage guidelines
  • Moved styles from overrides.css into component styles.ts file
  • Minor styling updates

Option

  • Update documentation examples
  • Add icon guidelines
  • Moved styles from overrides.css into component styles.ts file
  • Minor styling updates

Menu, Menu Item, Menu Label

  • Update documentation examples
  • Add icon guidelines
  • Moved styles from overrides.css into component styles.ts file
  • Minor styling updates

Misc

  • Bump Font Awesome registry to v6.5.0
  • Replace system icons with Font Awesome svgs
    • eye, eye-slash (used in password Input)
    • x-circle-fill (used in clearable Input)
    • chevron-down (used in Select)
    • checked (used in Checkbox)
  • Add new system icon checked-option for use in Option and Menu to show selected options and menu items

@slhinyc slhinyc requested a review from a team March 13, 2024 17:20
Copy link

vercel bot commented Mar 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
shoelace ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 14, 2024 3:42pm

@@ -20,8 +20,8 @@ export default css`
font-weight: var(--sl-font-weight-normal);
line-height: var(--sl-line-height-normal);
letter-spacing: var(--sl-letter-spacing-normal);
color: var(--sl-color-neutral-700);
padding: var(--sl-spacing-2x-small) var(--sl-spacing-2x-small);
color: var(--ts-color-text-default);

Choose a reason for hiding this comment

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

I have reservations about using the ts-- variables directly in the Shoelace stylesheets, because then we're kind of creating a circular dependency. As I understand it, we shouldn't need to use those values directly, because we're overriding the Shoelace values with their corresponding ts values already. Open to discussion on that.

Copy link
Author

Choose a reason for hiding this comment

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

Ah, I see -- so we should use --sl-color-neutral-900 here, you mean? I was thinking this makes the code more readable for us, since we know right away what ts-color-text-default is. But I'm fine to update all these to remove the --ts variable and replace with the --sl equivalent.

There are a few places where we had to create our own hard-coded --ts token rather than overriding an existing --sl token because the value we wanted kinda fell between two --sl tokens that we wanted to keep. In those cases, do you think it's okay to reference the --ts token directly?

Also -- okay with you if I just keep that in mind as the new approach & update these instances in the new branch that I'm working on?

Choose a reason for hiding this comment

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

Yeah, that's fine to just update in the other branch. I think if we're creating new values, we might want to just create those as --sl values as well, so we have consistency in our approach across the board.

Copy link
Author

Choose a reason for hiding this comment

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

ah, okay. we have several of these custom -ts values so i think i will pull this work of updating this into a separate ticket, then? but what you are saying makes sense to me. agree that we should be consistent!

Choose a reason for hiding this comment

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

Yep, that's fine.

@@ -75,7 +75,7 @@ export default css`

.tag--small {
font-size: var(--sl-button-font-size-medium);
height: calc(var(--sl-input-height-small) * 0.9);
height: calc(var(--sl-input-height-small) * 0.85715);

Choose a reason for hiding this comment

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

We might want to make sure these render OK in different browsers / platforms. I feel like some of them are pickier about how they render odd font sizes.

Copy link
Author

Choose a reason for hiding this comment

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

Ah, great call. What do you think if I just did away with the calc function entirely and just add a variable for the height that we know we want these to be? Feels more straightforward? If that sounds good to you, I'll update.

Copy link
Author

Choose a reason for hiding this comment

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

I just pushed a commit to update the * by decimal to a - by a rem value that gives us the same effective height that we want

Choose a reason for hiding this comment

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

Sounds good, although I'm not seeing that reflected here yet

Copy link
Author

Choose a reason for hiding this comment

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

See my comment below

Copy link

@CrookedGrin CrookedGrin left a comment

Choose a reason for hiding this comment

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

Overall looks great, just a few comments/questions.

@@ -75,21 +75,21 @@ export default css`

.tag--small {
font-size: var(--sl-button-font-size-medium);
height: calc(var(--sl-input-height-small) * 0.85715);
height: calc(var(--sl-input-height-small) - 0.25rem); /* 24px */
Copy link
Author

Choose a reason for hiding this comment

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

@CrookedGrin -- Here is that change from the * decimal to - a rem value! I don't know why github doesn't update the code block near the comment or at least give us the option of seeing the "old version" and the "new version"? 🤷‍♀️

Choose a reason for hiding this comment

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

Hmm, weird. Anyway, looks good!

@CrookedGrin CrookedGrin merged commit 6074cfc into next Mar 14, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants