posthog icon indicating copy to clipboard operation
posthog copied to clipboard

feat: LemonLabel / Improved Field

Open benjackwhite opened this issue 2 years ago • 2 comments

Problem

Design System work for improved Labels, and therefor improved Field component (mixture of label, input and error messages)

Changes

  • Adds a new LemonLabel to be used wherever a Field is not possible
  • Refactors Field to have a "Pure" version for simple rendering and a standard version for use with kea - no more antd styles. No more annoying overrides
  • Removes VerticalForm as all fields are now vertical.

(See deployed Storybook for more but here is a screenshot)

Screenshot 2022-08-09 at 18 09 50

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

How did you test this code?

benjackwhite avatar Aug 09 '22 15:08 benjackwhite

Looks good. The one thing I see is the optional label. Those are most often using the secondary text color and should use sentence case (lowercase o). 👍

Good catch. Im actually wondering about keeping the property "optional" as a Boolean which prefills the label with this content. Seems to be the most commonly used use case for it so may as well standardise it. Would still have the escape hatch of using the component style label if there was a different need.

benjackwhite avatar Aug 09 '22 18:08 benjackwhite

Good catch. Im actually wondering about keeping the property "optional" as a Boolean which prefills the label with this content. Seems to be the most commonly used use case for it so may as well standardise it. Would still have the escape hatch of using the component style label if there was a different need.

Sounds like a good plan. The optional piece is really the only variation I know of for form labels. Sometimes they have icons to hang tooltips from, but it's rare.

clarkus avatar Aug 09 '22 18:08 clarkus