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

UI Base package #13024

Merged
merged 1 commit into from
Jul 18, 2023
Merged

UI Base package #13024

merged 1 commit into from
Jul 18, 2023

Conversation

Jordan-Mysten
Copy link
Contributor

Description

Describe the changes or additions included in this PR.

Test Plan

How did you test the new or updated feature?


If your changes are not user-facing and not a breaking change, you can skip the following section. Otherwise, please indicate what changed, and then add to the Release Notes section as highlighted during the release process.

Type of Change (Check all that apply)

  • protocol change
  • user-visible impact
  • breaking change for a client SDKs
  • breaking change for FNs (FN binary must upgrade)
  • breaking change for validators or node operators (must upgrade binaries)
  • breaking change for on-chain data layout
  • necessitate either a data wipe or data migration

Release notes

@vercel
Copy link

vercel bot commented Jul 17, 2023

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

Name Status Preview Comments Updated (UTC)
explorer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 17, 2023 10:39pm
explorer-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 17, 2023 10:39pm
multisig-toolkit ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 17, 2023 10:39pm
sui-kiosk ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 17, 2023 10:39pm
sui-wallet-kit ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 17, 2023 10:39pm
wallet-adapter ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 17, 2023 10:39pm

@vercel vercel bot temporarily deployed to Preview – explorer-storybook July 17, 2023 21:02 Inactive
@vercel vercel bot temporarily deployed to Preview – explorer-storybook July 17, 2023 21:45 Inactive
@vercel vercel bot temporarily deployed to Preview – sui-wallet-kit July 17, 2023 21:45 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-adapter July 17, 2023 21:45 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-adapter July 17, 2023 22:06 Inactive
@vercel vercel bot temporarily deployed to Preview – sui-wallet-kit July 17, 2023 22:06 Inactive
@vercel vercel bot temporarily deployed to Preview – explorer-storybook July 17, 2023 22:06 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-adapter July 17, 2023 22:10 Inactive
@vercel vercel bot temporarily deployed to Preview – explorer-storybook July 17, 2023 22:10 Inactive
@vercel vercel bot temporarily deployed to Preview – sui-wallet-kit July 17, 2023 22:11 Inactive
@Jordan-Mysten Jordan-Mysten marked this pull request as ready for review July 17, 2023 22:23
@Jordan-Mysten Jordan-Mysten requested a review from a team as a code owner July 17, 2023 22:23
@Jordan-Mysten Jordan-Mysten requested review from williamrobertson13 and pchrysochoidis and removed request for a team July 17, 2023 22:23
Copy link
Contributor

@williamrobertson13 williamrobertson13 left a comment

Choose a reason for hiding this comment

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

lgtm besides one small thing - excited about this!

</div>
);
},
} satisfies Meta<typeof Button>;
Copy link
Contributor

Choose a reason for hiding this comment

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

nioce improved type safety 😉

apps/ui/src/Button.stories.tsx Show resolved Hide resolved
apps/ui/src/Button.tsx Show resolved Hide resolved
Copy link
Contributor

@williamrobertson13 williamrobertson13 left a comment

Choose a reason for hiding this comment

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

Re-stamp!

({ variant, size, loading, children, before, after, asChild, ...props }, ref) => {
const Comp = asChild ? Slot : 'button';

if (asChild && (loading || before || after)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any benefit to enforcing this at the type level or too overkill maybe? This works fine though haha

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's certainly possible, I was just thinking it's probably overkill, and I'm slowly getting convinced that consumers should just do the before / after themselves (loading is still iffy, but there's probably a clever way to do it without needing to compose the children layout).

@Jordan-Mysten Jordan-Mysten merged commit 993f7c0 into main Jul 18, 2023
@Jordan-Mysten Jordan-Mysten deleted the jordan--ui-base branch July 18, 2023 03:43
stefan-mysten pushed a commit to stefan-mysten/sui that referenced this pull request Jul 18, 2023
## Description 

Describe the changes or additions included in this PR.

## Test Plan 

How did you test the new or updated feature?

---
If your changes are not user-facing and not a breaking change, you can
skip the following section. Otherwise, please indicate what changed, and
then add to the Release Notes section as highlighted during the release
process.

### Type of Change (Check all that apply)

- [ ] protocol change
- [ ] user-visible impact
- [ ] breaking change for a client SDKs
- [ ] breaking change for FNs (FN binary must upgrade)
- [ ] breaking change for validators or node operators (must upgrade
binaries)
- [ ] breaking change for on-chain data layout
- [ ] necessitate either a data wipe or data migration

### Release notes
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.

3 participants