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 #32

Closed
wants to merge 16 commits into from
Closed

Conversation

slhinyc
Copy link

@slhinyc slhinyc commented Feb 23, 2024

👉 Review app


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 CrookedGrin as a code owner February 23, 2024 22:35
Copy link

vercel bot commented Feb 23, 2024

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

Name Status Preview Updated (UTC)
shoelace ✅ Ready (Inspect) Visit Preview Feb 23, 2024 10:36pm

@slhinyc slhinyc requested a review from a team February 23, 2024 22:36
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, this is awesome. Nice and clean, and a big improvement, especially the clear guidelines. A couple small questions, but looks good otherwise!

<sl-tag variant="neutral" size="small" pill> Since Shoelace {{component.since or '?' }}
</sl-tag>
<sl-tag size="small" variant="{{ badgeVariant }}" pill style="text-transform: capitalize">
{% extends "default.njk" %} {# Find the component based on the `tag` front matter #} {% set component =

Choose a reason for hiding this comment

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

What's going on with the spacing in this block? It looks like it might have lost some readability here

Copy link
Author

Choose a reason for hiding this comment

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

This happened because VS code didn't auto-select nunjucks as the language mode & it reformatted the entire page automatically as HTML after I made a small change. Realized I can manually set the language mode to nunjucks to put the formatting back, so this is now fixed on the new rebased branch I just pushed

{% endfor %}
</ul>
{% endif %} {% endblock %}

Choose a reason for hiding this comment

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

I can't really tell from looking at this diff, but are all of the changes in this file just spacing / indentation stuff? Really wish GH was better at understanding when that's the case, or displaying it intelligently.

Copy link
Author

Choose a reason for hiding this comment

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

No, the spacing & indentation was just VS code being weird (see my other comment about the nunjucks formatting). The change here was to the "Guidelines" section (line 81) -- I realized the anchor links were not working properly (because of the way the nunjucks file is setup, I think?) for the the Guidelines subheadings, so I just switched them to have one "Usage Guidelines" header with just bolded section titles below.

@@ -1765,6 +1773,10 @@ sl-card.small-footer::part(footer) {
margin-bottom: 1rem;
}

sl-breadcrumb.component-header::part(base) {

Choose a reason for hiding this comment

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

is this only for the docsite?

Copy link
Author

Choose a reason for hiding this comment

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

Yes, just for the doc site

@@ -1,6 +1,6 @@
# Changelog

## 2.0.1
## 2.0.2

Choose a reason for hiding this comment

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

I think a PR this size warrants a bump up by minor version, to 2.1.0.

Copy link
Author

Choose a reason for hiding this comment

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

Ah, this was me fixing my typo from the last patch release (where I repeated 2.0.1 twice). Now moot since we're releasing everything as 2.1.0 with the new upgarde!

```

Once all that is set up, you'll start your app like normal, i.e. `rails server` and `yarn build:all`. After each change in Shoelace, you'll need to run `npm run build` to generate the production build that `shared-ui` picks up. If you're using `yarn build --watch` and `yarn build:css --watch`, you'll need to restart those after each change as well.
Once all that is set up, you'll start your app like normal, i.e. `rails server` and `yarn build:all`. After each change in Shoelace, you'll need to run `npm run build` to generate the production build that `design-system` picks up. If you're using `yarn build --watch` and `yarn build:css --watch`, you'll need to restart those after each change as well.

Choose a reason for hiding this comment

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

The canonical command for starting our apps is now yarn dev, and the watch commands below are no longer necessary. You also don't actually need to re-build on every change; that was a relic of the older version of Shoelace. We can replace this whole paragraph with:

Once all that is set up, you'll start your app like normal via `yarn dev`. Changes made in Shoelace should automatically be reflected in your app.

Copy link
Author

Choose a reason for hiding this comment

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

okay! updated in the new rebased branch!

@@ -261,7 +274,7 @@ export default css`
display: inline-flex;
align-items: center;
justify-content: center;
font-size: inherit;
font-size: var(--sl-font-size-large);

Choose a reason for hiding this comment

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

This change worries me a bit. Are we completely sure we always want it to be large text?

Copy link
Author

Choose a reason for hiding this comment

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

This is for classes that are applied to the "clear" and password "eye" icons only -- not for the main input text. With the old system icons, the size could be the same as the font-size of the main input, but with the Font Awesome icons we're using now, they work better at a slightly larger size (20px) than the main input text (16px)

}

:host(:focus-visible) .menu-item {
:host(:focus-visible:not([aria-disabled='true'])) .menu-item {

Choose a reason for hiding this comment

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

Nice

@@ -78,7 +78,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.

Is this because Inter is slightly different from their default font?

Copy link
Author

Choose a reason for hiding this comment

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

This is more because we decided to make our input heights slightly different from the Shoelace default, so if we apply the same * .8 calc to our input heights, we'll get a decimal value height for our tags, which we wanted to avoid.

@slhinyc
Copy link
Author

slhinyc commented May 6, 2024

Closing this, as a rebased version of this branch was already merged a while ago

@slhinyc slhinyc closed this May 6, 2024
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