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

DSD-1623: label spacing for DatePicker, Select, Slider, and TextInput #1562

Merged
merged 6 commits into from
Apr 1, 2024

Conversation

bigfishdesign13
Copy link
Collaborator

@bigfishdesign13 bigfishdesign13 commented Mar 21, 2024

Fixes JIRA ticket DSD-1623

This PR does the following:

  • Updates the DatePicker, Select, Slider, and TextInput components to reduce the spacing between the field label and the field itself from "8px" to "2px".
  • NOTE: The FilterBar and MultiSelectGroup components were not addressed because they have not yet been reintroduced back into the DS.

How has this been tested?

  • local Storybook

Accessibility concerns or updates

  • n/a

Checklist:

  • I have updated the Storybook documentation accordingly.
  • I have added relevant accessibility documentation for this pull request.
  • All new and existing tests passed.

Front End Review:

  • Review the Vercel preview deployment once it is ready.

Copy link

vercel bot commented Mar 21, 2024

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

Name Status Preview Comments Updated (UTC)
nypl-design-system ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 1, 2024 8:13pm

@@ -125,6 +125,10 @@ const labelLegendText = {
color: "dark.ui.typography.heading",
},
};
// Used in form inputs that require nuanced spacing.
const labelLegendTextSpecialSpacing = {
marginBottom: "xxxs",
Copy link
Member

Choose a reason for hiding this comment

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

Why not add this rule to fieldset.ts and label.ts? This seems like it'll be easier to miss if the update is in the component file than the style file.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was following the pattern of labelLegendText because I wanted a reusable object.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, but labelLegendText is used in fieldset.ts and label.ts and not in the __css prop for the components. So what's here is fine but if we can keep the update in the theme files, that'd be ideal.

Copy link
Member

@EdwinGuzman EdwinGuzman left a comment

Choose a reason for hiding this comment

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

Approving but would like to see this in the theme file at some point if possible.


const DatePicker = defineMultiStyleConfig({
baseStyle: definePartsStyle({
fieldset: {
legend: { ...labelLegendTextSpecialSpacing },
Copy link
Member

Choose a reason for hiding this comment

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

This can be legend: labelLegendTextSpecialSpacing,

Copy link
Member

@EdwinGuzman EdwinGuzman left a comment

Choose a reason for hiding this comment

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

Update looks good but just needs one minor update.

@bigfishdesign13 bigfishdesign13 removed the Needs Review Pull requests that are ready for peer review. label Apr 1, 2024
@bigfishdesign13 bigfishdesign13 added the Ship It Pull requests that have been reviewed and approved. label Apr 1, 2024
@bigfishdesign13 bigfishdesign13 merged commit 62242e0 into development Apr 1, 2024
5 checks passed
@bigfishdesign13 bigfishdesign13 deleted the DSD-1623/form-input-label-spacing branch April 1, 2024 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ship It Pull requests that have been reviewed and approved.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants