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

Build out the <FormField /> and <TextInput /> components, and add other features in preparation for new v2 pages #1653

Merged
merged 14 commits into from
Aug 9, 2024

Conversation

jessepinho
Copy link
Contributor

@jessepinho jessepinho commented Aug 6, 2024

This is another PR where I was planning on making some new v2 pages, but then realized how many more components still had to be built before I could create the pages.

In this PR

  • Build out the <Card /> component further with <Card.Stack /> and <Card.Section /> sub-components.
  • Update a few theme values.
  • Create <FormField /> and <TextInput /> components.
  • Make it possible to disable an entire <SegmentedControl /> (rather than just one of its options).
  • Create a new DisabledContext and useDisabled() hook.
    • This allows users to pass disabled to <FormField /> without having to also pass it to whatever input component is the <FormField />'s children. <FormField /> then sets the disabled context to true, which is then read by the child input component.
  • Extract ActionType into a shared type used by multiple files.

Copy link

changeset-bot bot commented Aug 6, 2024

🦋 Changeset detected

Latest commit: 6f9f614

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

This PR includes changesets to release 3 packages
Name Type
@repo/ui Minor
minifront Patch
node-status 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

Copy link
Contributor

github-actions bot commented Aug 6, 2024

Visit the preview URL for this PR (updated for commit 6f9f614):

https://penumbra-ui-preview--pr1653-jessepinho-input-7kxh64ru.web.app

(expires Fri, 16 Aug 2024 00:09:16 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 709d729610ef7a6369b23f1cb2b820a60cc685b1

@jessepinho jessepinho force-pushed the jessepinho/input branch 3 times, most recently from 35206cd to ec240ff Compare August 8, 2024 00:58
@jessepinho jessepinho changed the base branch from main to jessepinho/assets-transactions August 8, 2024 01:02
@jessepinho jessepinho force-pushed the jessepinho/input branch 2 times, most recently from c32787f to 6dcb645 Compare August 8, 2024 01:54
Base automatically changed from jessepinho/assets-transactions to main August 8, 2024 19:48
@@ -37,7 +37,7 @@ export const AssetsPage = () => {
});

return (
<div className='flex flex-col gap-1'>
<>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The div was never needed, since it only had one child

@@ -30,16 +30,14 @@ export const DashboardLayout = () => {

<Grid tablet={8} desktop={6} xl={4}>
<Card title={CARD_TITLE_BY_PATH[v2PathPrefix(pagePath)]}>
<div className='flex flex-col gap-4'>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This wrapper is no longer needed, since <Card /> now applies a spacing of 4 to all its direct children

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@jessepinho jessepinho Aug 8, 2024

Choose a reason for hiding this comment

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

I added a bunch more content to the card in this story, to show how it can be used (especially with the new <Card.Stack /> and <Card.Section /> subcomponents).

@@ -71,7 +71,7 @@ const Color = <T extends Exclude<TColor, 'action' | 'other' | 'base'>>({ color }
<Grid mobile={6} tablet={10}>
<Variants>
{color === 'text'
? (['primary', 'secondary', 'disabled', 'special'] as const).map(variant => (
? (['primary', 'secondary', 'muted', 'special'] as const).map(variant => (
Copy link
Contributor Author

Choose a reason for hiding this comment

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

(due to the updated theme values)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Some color updates per Figma

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jessepinho jessepinho changed the title WIP: Input field Build out the <FormField /> and <TextInput /> components, and add other features in preparation for new v2 pages Aug 9, 2024
@jessepinho jessepinho requested a review from a team August 9, 2024 00:07
@jessepinho jessepinho marked this pull request as ready for review August 9, 2024 00:07
Copy link
Collaborator

@grod220 grod220 left a comment

Choose a reason for hiding this comment

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

LGTM

@jessepinho jessepinho merged commit 2a76fce into main Aug 9, 2024
8 checks passed
@jessepinho jessepinho deleted the jessepinho/input branch August 9, 2024 17:42
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