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(react): add Placeholder color props #6232

Merged
merged 4 commits into from
Dec 11, 2024

Conversation

tiffanynwyeung
Copy link
Member

Description of changes

  • add startColor and endColor props to Placeholder component as well as corresponding types
  • add/update related ui/react tests
  • update ui/docs examples and tests

Issue #, if available

Resolves #3958.

Description of how you validated changes

Docs Demo
image

Docs Example
image
image

Checklist

  • Have read the Pull Request Guidelines
  • PR description included
  • yarn test passes and tests are updated/added
  • PR title and commit messages follow conventional commit syntax
  • If this change should result in a version bump, changeset added (This can be done after creating the PR.) This does not apply to changes made to docs, e2e, examples, or other private packages.

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

Copy link

changeset-bot bot commented Dec 2, 2024

🦋 Changeset detected

Latest commit: 6cf5537

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@aws-amplify/ui-react Patch
@aws-amplify/ui-react-auth Patch
@aws-amplify/ui-react-liveness Patch
@aws-amplify/ui-react-notifications Patch
@aws-amplify/ui-react-storage Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@@ -12,8 +12,13 @@ import {
import { View } from '../View';
import { primitiveWithForwardRef } from '../utils/primitiveWithForwardRef';

export const CSS_VAR_START_COLOR: string =
Copy link
Member Author

@tiffanynwyeung tiffanynwyeung Dec 2, 2024

Choose a reason for hiding this comment

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

Note: the explicit type declaration here is because csstype deliberately does not recognize CSS variables/custom properties, and they recommend doing either module augmentation or type assertions as a workaround to type errors.

I'm also not too sure about how best to name these constants so feedback/suggestions are welcomed.

Copy link
Member

@jordanvn jordanvn left a comment

Choose a reason for hiding this comment

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

I think this looks good to me. But I would like to see if @calebpollman or @dbanksdesign have thoughts on how the CSS variable is assigned. It seems like it could be cleaner, but I also can't think of a better approach.

Copy link
Contributor

@dbanksdesign dbanksdesign left a comment

Choose a reason for hiding this comment

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

LGTM!

@tiffanynwyeung tiffanynwyeung merged commit 4a9e16c into main Dec 11, 2024
34 checks passed
@tiffanynwyeung tiffanynwyeung deleted the placeholder/add-color-props branch December 11, 2024 20:26
@github-actions github-actions bot mentioned this pull request Dec 10, 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.

FR (Primitives): Placeholder should have startColor and endColor props
3 participants