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: account list select component #3287

Merged
merged 13 commits into from
Nov 21, 2024
Merged

feat: account list select component #3287

merged 13 commits into from
Nov 21, 2024

Conversation

magiziz
Copy link
Contributor

@magiziz magiziz commented Nov 20, 2024

Description

  • Added account list select component
  • Added font-feature-settings option to <wui-text>

Type of change

  • Chore (non-breaking change that addresses non-functional tasks, maintenance, or code quality improvements)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Associated Issues

For Linear issues: Closes APKT-1500

Showcase (Optional)

Screenshot 2024-11-20 at 18 32 20 Screenshot 2024-11-20 at 18 32 29

Checklist

  • Code in this PR is covered by automated tests (Unit tests, E2E tests)
  • My changes generate no new warnings
  • I have reviewed my own code
  • I have filled out all required sections
  • I have tested my changes on the preview link
  • Approver of this PR confirms that the changes are tested on the preview link

Copy link

linear bot commented Nov 20, 2024

Copy link

changeset-bot bot commented Nov 20, 2024

⚠️ No Changeset found

Latest commit: be9b285

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copy link

vercel bot commented Nov 20, 2024

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

Name Status Preview Comments Updated (UTC)
appkit-gallery-new 🛑 Canceled (Inspect) Nov 21, 2024 8:44am
appkit-laboratory ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 21, 2024 8:44am
appkit-vue-solana ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 21, 2024 8:44am
appkit-wagmi-cdn-example ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 21, 2024 8:44am
vue-wagmi-example ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 21, 2024 8:44am

Copy link
Contributor

github-actions bot commented Nov 20, 2024

Coverage Report for Coverage

Status Category Percentage Covered / Total
🔵 Lines 335.7% 4838 / 23584
🔵 Statements 335.7% 4838 / 23584
🔵 Functions 368.88% 388 / 1431
🔵 Branches 475.80999999999995% 745 / 1724
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/ui-new/index.ts 0% 0% 0% 0%
packages/ui-new/src/assets/svg/mail.ts 0% 0% 0% 0%
packages/ui-new/src/components/wui-shimmer/index.ts 0% 0% 0% 0%
packages/ui-new/src/components/wui-text/styles.ts 0% 0% 0% 0%
packages/ui-new/src/composites/wui-avatar/styles.ts 0% 0% 0% 0%
packages/ui-new/src/composites/wui-button/index.ts 0% 0% 0% 0%
packages/ui-new/src/composites/wui-list-select-account/index.ts 0% 0% 0% 0%
packages/ui-new/src/composites/wui-list-select-account/styles.ts 0% 0% 0% 0%
packages/ui-new/src/composites/wui-wallet-image/index.ts 0% 0% 0% 0%
packages/ui-new/src/layout/wui-flex/index.ts 0% 0% 0% 0%
packages/ui-new/src/utils/JSXTypeUtil.ts 100% 100% 100% 100%
packages/ui-new/src/utils/TypeUtil.ts 0% 100% 100% 0%
packages/ui-new/src/utils/UiHelperUtil.ts 27.27% 66.66% 15.38% 27.27%
Generated in workflow #7499 for commit 2196554 by the Vitest Coverage Report Action

@@ -16,7 +16,7 @@ export class WuiShimmer extends LitElement {

@property() public height = ''

@property() public borderRadius: BorderRadiusType = 'm'
@property() public borderRadius: BorderRadiusType = '2'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed this to "2" for now to not get any errors. Will come back to shimmer component and fix it.

Comment on lines +47 to +49
font-feature-settings:
'liga' off,
'clig' off;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added this css font feature setting to KHTeka font only

Comment on lines +30 to 37
let borderRadius: BorderRadiusType = '1'
if (this.size === 'lg') {
borderRadius = 'm'
borderRadius = '3'
} else if (this.size === 'md') {
borderRadius = 'xs'
borderRadius = '2'
} else {
borderRadius = 'xxs'
borderRadius = '1'
}
Copy link
Contributor Author

@magiziz magiziz Nov 20, 2024

Choose a reason for hiding this comment

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

Same here just a tweaked it for now

Comment on lines +33 to +34
<wui-avatar size="sm" address=${this.address}></wui-avatar>
<wui-icon class="avatarIcon" size="xs" name=${this.icon}></wui-icon>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should create avatar + badge component instead of doing it manually. I created a ticket called APKT-1507 where we comment down all todos so we don't forget.

Comment on lines 60 to 62
<wui-text color="secondary" variant="lg-regular-mono" lineClamp="1">
$${this.dollars}.${this.pennies}
</wui-text>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same here would be better to have dollar balance component

Comment on lines 13 to 14
dollars: '1740',
pennies: '72',
Copy link
Contributor

Choose a reason for hiding this comment

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

Why these two are different properties? We should instead format the number inside. We should have such utilities

Copy link
Contributor

Choose a reason for hiding this comment

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

Also tried removing penny value in story and there is still dot after dollars value: https://appkit-gallery-brxkv59qj-reown-com.vercel.app/?path=/docs/composites-wui-list-select-account--docs

Copy link
Contributor

Choose a reason for hiding this comment

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

Same when you remove dollar value, you see "$." in the component

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just added UiHelperUtil.formatCurrency function which will convert numbers into formatted dollar value 🙏

Comment on lines +47 to +49
font-feature-settings:
'liga' off,
'clig' off;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need these?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I noticed i forgot to add these from figma heading designs. Apparently it'll provide more advanced typographic features and make fonts cleaner 👌

Comment on lines 19 to 21
@property() pennies = '00'

@property() address = ''
Copy link
Contributor

Choose a reason for hiding this comment

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

Same for the comment above, I think better practice instead of getting these values separately, getting the value and format it here with floating numbers. Also for such components it's important to make sure we're testing them with different values like very small values and very big numbers


@property() icon: IconType = 'mail'

@property({ type: Number }) dollarAmount = 0
Copy link
Contributor

Choose a reason for hiding this comment

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

For future features, maybe we would start showing different currencies depending on the user's choice, what about separating amount and currency and we would keep the currency USD by default for now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea. Let me do that.

columnGap="2"
>
<wui-text color="secondary" variant="lg-regular-mono" lineClamp="1">
${UiHelperUtil.formatCurrency(this.dollarAmount)}
Copy link
Contributor

Choose a reason for hiding this comment

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

Awesome

@@ -16,6 +16,24 @@ export const UiHelperUtil = {
return new Intl.DateTimeFormat('en-US', { month: 'short', day: 'numeric' }).format(date)
},

formatCurrency(amount: number | string = 0, options: Intl.NumberFormatOptions = {}) {
const numericAmount = Number(amount)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we cast it to number? What if the number is comes float? and when there are many floating numbers, isn't this will remove them?

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay seems like not yeah

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