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

refactor(OnyxAvatar): update default initials #2450

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

larsrickert
Copy link
Collaborator

@larsrickert larsrickert commented Jan 8, 2025

closes #2442

Previously the initials were taken from the first two words. Now they will be used from the first and last word.

Example for "John Middlename Doe":

  • Previously: "JM"
  • Now: "JD"

The default slot has been removed in favor of the initials property to set custom initials.

Checklist

  • The added / edited code has been documented with JSDoc
  • If a new component is added, at least one Playwright screenshot test is added
  • A changeset is added with npx changeset add if your changes should be released as npm package (because they affect the library usage)

@larsrickert larsrickert requested a review from a team as a code owner January 8, 2025 11:16
Copy link

changeset-bot bot commented Jan 8, 2025

🦋 Changeset detected

Latest commit: 3eee875

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

This PR includes changesets to release 6 packages
Name Type
sit-onyx Major
demo-app Patch
playground Patch
@sit-onyx/chartjs-plugin Major
@sit-onyx/nuxt Major
@sit-onyx/vitepress-theme Major

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

@JoCa96 JoCa96 force-pushed the larsrickert/2442-avatar-initials branch from ae41f2a to 3eee875 Compare January 8, 2025 16:53
@@ -6,18 +6,13 @@ const props = withDefaults(defineProps<OnyxAvatarProps>(), {
size: "48px",
});

const slots = defineSlots<{
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please leave the option in to use a slot, then we don't have a breaking change

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Personally, I don't like having two ways for doing the same thing 🤔 Since slot also allows non-text content which we propably don't want to support, I'd prefer the propert.
What do you think?

@JoCa96 JoCa96 self-assigned this Jan 9, 2025
@larsrickert larsrickert marked this pull request as draft January 9, 2025 09:13
@ChristianBusshoff ChristianBusshoff marked this pull request as ready for review January 14, 2025 14:36
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