Skip to content

Feat/Avatar builder and component #16

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

Merged
merged 9 commits into from
Jan 22, 2025
Merged

Feat/Avatar builder and component #16

merged 9 commits into from
Jan 22, 2025

Conversation

jzylks
Copy link
Contributor

@jzylks jzylks commented Jan 4, 2025

An Avatar builder and component, ported from melt-ui:

Screenshot 2025-01-04 at 12 31 30 PM

A couple additional items that were related (let me know if you would like these broken out in a different PR):

  • Adds a StringControl to the preview for modifying the src prop
  • Sets the text color for the interactive preview prop fields to text-gray-100 (it was black on dark gray when not in dark mode)

Copy link

changeset-bot bot commented Jan 4, 2025

🦋 Changeset detected

Latest commit: 3a7317e

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

This PR includes changesets to release 1 package
Name Type
melt Minor

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

Copy link

vercel bot commented Jan 4, 2025

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

Name Status Preview Comments Updated (UTC)
next-gen ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 22, 2025 3:23pm

Copy link
Member

@TGlide TGlide left a comment

Choose a reason for hiding this comment

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

Thank you so much! Left a few comments, and I believe we can change the bg of the input for controls to be a lighter color. Nonetheless the change is very welcome!

Instead of calling `getters` with the props for the Avatar builder, wrap the
entire `new Avatar()` call in `$derived`. Causes a new instance to be created
if the props change, resetting the loading status.

call in `$derived`
- Previous commit only reset loading status and reloaded the image correctly
  if the `src` prop was changed. If `delayMs` wash change, the loading
  status was reset, but `onload()` never fired. Reverting to using `getters`
- Add `MaybeGetter` to Avatar props
- Remove MaybeGetter from onLoadingStatusChange
- Remove Synced from loadingStatus
- Put onLoadingStatusChange into an $effect
- Added `dark:` to example inputs and removed the explicit text color
@TGlide TGlide merged commit 52d2bf0 into melt-ui:main Jan 22, 2025
1 check was pending
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