Skip to content

Conversation

@jbadan
Copy link
Contributor

@jbadan jbadan commented Feb 21, 2020

Description

I was originally going to upgrade only to 0.4.0-rc.10, but there were no additional breaking changes between 0.4.0-rc.10 and rc-24.

Changes bold denotes breaking change:

FormInput

  • changed state prop options to match new validation states

Checkbox

  • new state prop: added validation states

FormRadioGroup

  • div to Fragment to match html from Fundamental Styles

FormItem

  • new isHorizontal prop
  • isInline becomes internal only prop as it is only meant for Checkboxes and Radios

FormRadioItem

  • new compact prop
  • new state prop: added validation states
  • inline prop becomes internal use only - should only be applied to FormRadioGroup

FormSelect

  • new state prop: added validation states
  • new compact prop

FormTextarea

  • new compact, disabled and readOnly props
  • new state prop: added validation states

Combobox Input

  • rebuilt with InputGroup
  • new state prop: added validation states

SearchInput

  • rebuilt with InputGroup
  • new state prop: added validation states

InputGroup

  • new disabled prop
  • new state prop: added validation states
  • fixed compact prop so that appropriate fd-input-group__addon—compact class is added to InputGroup.Addon

MultiInput

  • rebuilt with InputGroup
  • changed placeHolder prop to placeholder
  • new state prop: added validation states

FormLabel

  • reworked required prop
  • new is-Toggle prop - internal use only
  • new is-Checkbox prop - internal use only
  • new is-Radio prop - internal use only
  • new is-InlineHelp prop - add this to any labels used with InlineHelp component

FormMessage

  • changed types options: help -> information

TimePicker

  • rebuilt with InputGroup

Alert

  • div for text changed to p

Known Issues out of the scope of this pr:

  • Dropdown missing top button border
  • InlineHelp doesn’t actually work when paired with FormLabel + FormInput
  • Spacing inside TimePicker popover with TimeItems
  • checkboxes and radios styling looks bad, but this is fixed in a later rc

"chain-function": "^1.0.1",
"classnames": "^2.2.6",
"fundamental-styles": "~0.4.0-rc.3",
"hoist-non-react-statics": "^3.3.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

hoist-non-react-statics should have been removed with withStyles

@netlify
Copy link

netlify bot commented Feb 21, 2020

@jbadan jbadan requested review from a team and meganaconley February 21, 2020 00:21
@jbadan
Copy link
Contributor Author

jbadan commented Feb 21, 2020

Closing this for now - I'm going to upgrade to 21 since a lot of the validation states were removed between 10 and 20, but added back in 21.

@jbadan jbadan closed this Feb 21, 2020
@jbadan jbadan reopened this Feb 21, 2020
@jbadan jbadan changed the title feat: upgrade fundamental-styles to 0.4.0-rc.20 feat: upgrade fundamental-styles to 0.4.0-rc.24 Feb 21, 2020
@jbadan jbadan requested a review from a team February 21, 2020 16:00
className,
'fd-checkbox'
'fd-checkbox',
{ [`is-${state}`]: state }
Copy link
Contributor

@skvale skvale Feb 21, 2020

Choose a reason for hiding this comment

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

I want to entertain this thought: Should we be defining classes with full strings instead of interpolation.

If we use string interpolation we wouldn't work with something like PurgeCSS in case a consumer wants to configure their project to minimize the imported styles.

So we'd want some utility to add the full strings here

 { ['is-warning']: state.warning, ['is-invalid']: state.invalid, ... }

PurgeCSS looks through all the imported CSS and removes the selectors that your app never uses, but it isn't smart enough to know all the values of state that could be included in the string.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I like the idea of this - maybe as a follow up if we want to use purgeCSS in nui-widgets/floorplans. We could go through all the components with these issues.

Copy link
Contributor

Choose a reason for hiding this comment

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

I also prefer to avoid string interpolation for classnames - they don't show up in search and replaces efforts, which inevitably leads to bugs.

Copy link
Contributor

Choose a reason for hiding this comment

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

I can see @bcullman's point and in our legacy applications I completely agree. However, I will say that in the world of self-contained styles, I don't think this is nearly as big of an issue anymore.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's 🅿️ this today... the more I think about it, the less I want to make this change

children: PropTypes.node,
className: PropTypes.string,
disableStyles: PropTypes.bool,
isHorizontal: PropTypes.bool,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't love the name of this prop 🤷‍♀

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like isHorizontal puts the label and the input side-by-side on the same visual row. That seems more like isInline to me, but I also see that prop existed before. I'm not quite sure what the difference is between isHorizontal and isInline. Looking at the fundamental-styles page on forms, there are no uses of fd-form-item--inline. 🤷‍♂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

--inline is only for inline labels for radio and checkbox. I think we can just go forward like this, then with the rc that changes how checkboxes and radios work can revisit that?

'is-disabled': disabled,
'fd-form-label--toggle': isToggle,
'fd-form-label--checkbox': isCheckbox,
'fd-form-label--radio': isRadio,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't really love this pattern - but checkbox and radio are going to change significantly in a couple more rc rev's so there's no point in really diving into it right now.

</Menu>
}
placeholder='Select Fruit' />
{...createProps()}
Copy link
Contributor

Choose a reason for hiding this comment

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

Going forward, it would be good to have one "default" story for each component that contains all the storybook knobs, but all additional stories should probably disable knobs as the stories really become specific use cases with all the appropriate props set and shouldn't be "played with" anymore. There are a few exceptions to this, yes, but it would be good if that was the general pattern. That said, not part of this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree! I started to do that... then realized it's soooo out of scope. What do you think about a story in the backlog to 1) upgrade storybook to use the "new" pattern we've established in floorplans 2) setup the stories consistently for the components?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, that sounds like a good plan.

children: PropTypes.node,
className: PropTypes.string,
disableStyles: PropTypes.bool,
isHorizontal: PropTypes.bool,
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like isHorizontal puts the label and the input side-by-side on the same visual row. That seems more like isInline to me, but I also see that prop existed before. I'm not quite sure what the difference is between isHorizontal and isInline. Looking at the fundamental-styles page on forms, there are no uses of fd-form-item--inline. 🤷‍♂

'fd-radio',
{
'fd-radio--compact': compact,
[`is-${state}`]: state
Copy link
Contributor

Choose a reason for hiding this comment

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

Not exactly "self-contained", but that's a WHOLE OTHER issue.

description={`Inputs are used to collect data from the user. When a field is required, the label is displayed in bold
and noted by an asterisk (*).`}
description={`Inputs are used to collect data from the user. When a field is required,
the <code>required</code> prop will include an asterisk (*).`}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the playground components are setup to support markdown if you didn't want to hardcode markup tags.

Copy link
Contributor

@greg-a-smith greg-a-smith left a comment

Choose a reason for hiding this comment

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

Looks good. 🚢

@jbadan jbadan merged commit abe8d31 into master Feb 24, 2020
@jbadan jbadan deleted the fix/update-fs branch February 24, 2020 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants