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

Create Form and TextInput components #33

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

Conversation

rgodha24
Copy link
Contributor

@rgodha24 rgodha24 commented Mar 8, 2025

closes #31

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Disclaimer: This comment was AI-generated and is not necessarily completely accurate. Please take code comments with a grain of salt.

PR Summary

This PR introduces new BogForm and BogTextInput components with their associated styles, implementing form functionality using Radix UI primitives and consistent styling patterns.

  • BogTextInput is missing 'search' type option in the type prop definition
  • Default value for required prop in BogTextInput should be false per requirements
  • Form.Message components in BogTextInput may cause layout issues being placed next to label
  • Style and className props are defined but unused in BogTextInput component

PR Score: 85/100

Checklist items needing attention:

Frontend

  • Uses appropriate hooks only when necessary
  • Uses relative positioning instead of absolute where appropriate

The implementation is solid overall but needs minor adjustments to fully meet requirements and maintain consistent styling patterns.

💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!

5 file(s) reviewed, 8 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines +11 to +14
&:focus {
outline: none;
border-color: var(--color-brand-stroke-strong);
}
Copy link

Choose a reason for hiding this comment

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

style: Consider adding a focus ring or box-shadow for better accessibility and visual feedback on focus

Suggested change
&:focus {
outline: none;
border-color: var(--color-brand-stroke-strong);
}
&:focus {
outline: none;
border-color: var(--color-brand-stroke-strong);
box-shadow: 0 0 0 2px var(--color-brand-stroke-weak);
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, this isn't in the Figma, but would you mind adding this. Obviously, not your mistake, I just think it looks better and it's something the designers should have put in initially.

onSubmit={(e) => {
e.preventDefault();
const data = Object.fromEntries(new FormData(e.currentTarget));
console.log(data);
Copy link

Choose a reason for hiding this comment

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

style: Remove console.log before production

Copy link
Contributor

@Nathan-Papa Nathan-Papa Mar 8, 2025

Choose a reason for hiding this comment

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

Yeah, thanks for leaving this behind for testing, but can you get rid of the log? If possible, could the event handler for the form on this page just be to clear all inputs on the form?

@rgodha24 rgodha24 force-pushed the rohan/31-form-component branch from cc10739 to cbf7423 Compare March 8, 2025 19:42
Copy link
Contributor

@Nathan-Papa Nathan-Papa left a comment

Choose a reason for hiding this comment

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

This looks awesome, thank you so much! Sorry for the nitpicky changes, but fortunately these should all be very easy to make.

Please provide a valid {label}
</Form.Message>
</div>
<Form.Control asChild>
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd like a little bit more vertical space between the stuff above the text input (label and messages) and the textbox itself please :)

placeholder={placeholder}
required={required}
disabled={disabled}
className={`${styles.input} text-paragraph-2`}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you style the placeholder text on both of these inputs like the Figma? I think there is a ::placeholder CSS selector, and it would just be setting the font to text-paragraph-2 and the color to var(--color-grey-stroke-strong)

border-color: var(--color-brand-stroke-strong);
}
&:disabled {
color: var(--color-grey-off-state);
Copy link
Contributor

Choose a reason for hiding this comment

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

For disabled, can we make the hover state not change the border and the cursor be 'not-allowed'

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.

[Frontend] Implement Form Component
2 participants