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

feat(autocomplete): add autocomplete component #10562

Open
wants to merge 73 commits into
base: dev
Choose a base branch
from

Conversation

driskull
Copy link
Member

@driskull driskull commented Oct 18, 2024

Related Issue: #10044

Summary

  • Adds calcite-autocomplete, calcite-autocomplete-item, and calcite-autocomplete-item-group
  • Adds e2e tests
  • Adds storybook
  • Adds HTML demos
  • Adds t9n strings
  • Follows Figma designs
  • Adds CSS tokens

Tokens

Autocomplete

--calcite-autocomplete-background-color: Specifies the background color of the component.
--calcite-autocomplete-corner-radius: Specifies the component's corner radius.
--calcite-autocomplete-text-color: Specifies the text color of the component.

--calcite-autocomplete-input-prefix-size: Specifies the Input's prefix width, when present.
--calcite-autocomplete-input-suffix-size: Specifies the Input's suffix width, when present.

--calcite-autocomplete-input-background-color: Specifies the background color of the Input.
--calcite-autocomplete-input-border-color: Specifies the border color of the Input.
--calcite-autocomplete-input-corner-radius: Specifies the corner radius of the Input.
--calcite-autocomplete-input-shadow: Specifies the shadow of the Input.

--calcite-autocomplete-input-icon-color: Specifies the icon color of the Input.
--calcite-autocomplete-input-text-color: Specifies the text color of the Input.
--calcite-autocomplete-input-placeholder-text-color: Specifies the color of placeholder text in the Input.

--calcite-autocomplete-input-actions-background-color: Specifies the background color of Input's clearable element.
--calcite-autocomplete-input-actions-background-color-hover: Specifies the background color of Input's clearable element when hovered.
--calcite-autocomplete-input-actions-background-color-press: Specifies the background color of Input's clearable element when pressed.
--calcite-autocomplete-input-actions-icon-color: Specifies the icon color of Input's clearable element.
--calcite-autocomplete-input-actions-icon-color-hover: Specifies the icon color of Input's clearable element when hovered.
--calcite-autocomplete-input-actions-icon-color-press: Specifies the icon color of Input's clearable element when pressed.

--calcite-autocomplete-input-loading-background-color: Specifies the background color of the Input's loading element, when present.
--calcite-autocomplete-input-loading-fill-color: Specifies the fill color of the Input's loading element, when present.

--calcite-autocomplete-input-prefix-background-color: Specifies the background color of the Input's prefix, when present.
--calcite-autocomplete-input-prefix-text-color: Specifies the text color of the Input's prefix, when present.

--calcite-autocomplete-input-suffix-background-color: Specifies the background color of the Input's suffix, when present.
--calcite-autocomplete-input-suffix-text-color: Specifies the text color of the Input's suffix, when present.

Autocomplete item

--calcite-autocomplete-background-color: Specifies the background color of the component.
--calcite-autocomplete-background-color-hover: Specifies the background color of the component when hovered.
--calcite-autocomplete-background-color-focus: Specifies the background color of the component when focused.
--calcite-autocomplete-description-text-color: Specifies the text color of the component's description.
--calcite-autocomplete-heading-text-color: Specifies the text color of the component's heading.
--calcite-autocomplete-text-color: Specifies the text color of the component.

Autocomplete item group

--calcite-autocomplete-background-color: Specifies the background color of the component.
--calcite-autocomplete-border-color: Specifies the border color of the component.
--calcite-autocomplete-text-color: Specifies the text color of the component.

@github-actions github-actions bot added the enhancement Issues tied to a new feature or request. label Oct 18, 2024
Copy link
Contributor

github-actions bot commented Nov 8, 2024

This PR has been automatically marked as stale because it has not had recent activity. Please close your PR if it is no longer relevant. Thank you for your contributions.

@github-actions github-actions bot added the Stale Issues or pull requests that have not had recent activity. label Nov 8, 2024
# Conflicts:
#	packages/calcite-components/index.html
#	packages/calcite-components/src/components.d.ts
#	packages/calcite-components/stencil.config.ts
@github-actions github-actions bot removed the Stale Issues or pull requests that have not had recent activity. label Nov 16, 2024
Copy link
Contributor

@alisonailea alisonailea left a comment

Choose a reason for hiding this comment

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

Just a few naming schema changes needed on autocomplete-item

@ashetland
Copy link

Can we remove the bg color change onHover for disabled items?

Copy link
Contributor

@alisonailea alisonailea left a comment

Choose a reason for hiding this comment

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

🚀

@driskull
Copy link
Member Author

driskull commented Dec 3, 2024

Can we remove the bg color change onHover for disabled items?

Done.

I'll work on adding all the input token vars next. I think all of them are applicable.

@ashetland
Copy link

Can we remove the bg color change onHover for disabled items?

Done.

Noice. Just noticed that we also have a bg color change while focusing items. For consistency, we should remove that so the focus ring and hover styling are separate.

* These properties can be overridden using the component's tag as selector.
*
* @prop --calcite-autocomplete-background-color: Specifies the background color of the component.
* @prop --calcite-autocomplete-background-color-hover: Specifies the background color of the component when hovered.
Copy link
Member Author

Choose a reason for hiding this comment

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

@alisonailea do we really need this var? I thought if a user could use the host to set the hover state bg color a var wasn't necessary?

Copy link
Member Author

Choose a reason for hiding this comment

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

Like:

calcite-autocomplete-item:hover{
--calcite-autocomplete-background-color: red;
}

Copy link

@ashetland ashetland left a comment

Choose a reason for hiding this comment

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

Lookin' gewd to me

add input vars, add corner radius var, remove action slots
@driskull
Copy link
Member Author

driskull commented Dec 3, 2024

@alisonailea added input vars and a corner radius var.

@driskull
Copy link
Member Author

driskull commented Dec 3, 2024

I removed the actions-start and actions-end slots as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issues tied to a new feature or request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants