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

feat: upgrade fundamental-styles to 0.11.0-rc.100 #1121

Merged
merged 26 commits into from
Jul 14, 2020

Conversation

jacobdevera
Copy link
Contributor

Description

Affected Components

  • Shellbar: classes updated (buttons should have focus outline); remove ‘fd-product-menu’ class
  • Select: role changed to combobox, aria-haspopup changed to listbox, fixing aria-disabled and aria-readonly
  • Table row selection styling
  • Checkbox: fd-checkbox__text class added for ellipsis overflow
  • Dialog: remove backdropClassName, remove overlay classes
  • DatePicker: fd-bar—cosy renamed to fd-bar—cozy; new icon for ‘choose date’ button
  • Icon: sizes removed, using font-size
  • Popover: is-expanded class added

@jacobdevera jacobdevera requested review from meganaconley and a team July 9, 2020 22:34
@jacobdevera jacobdevera self-assigned this Jul 9, 2020
@netlify
Copy link

netlify bot commented Jul 9, 2020

Deploy preview for fundamental-react ready!

Built with commit 00de77f

https://deploy-preview-1121--fundamental-react.netlify.app

Comment on lines 41 to 46
export const ICON_SIZES = {
's': '12px',
'm': '16px',
'l': '20px',
'xl': '24px'
};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Debating removing these like what was done for styles, but for some reason it feels wrong to not have predefined sizes and having the consumer set it.

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 icon sizes should not have been removed from fundamental-styles - I think this is fine until they add them back

Copy link
Contributor

@droshev droshev Jul 10, 2020

Choose a reason for hiding this comment

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

Fiori 3 doesn't have predefined sizes - the icon size follows the font-size
the values should be in rem at least:

0.75rem
1rem
1.25rem
1.5rem

displayRows = row.rowData.splice(1, row.rowData.length);
}

return (
<tr
className={tableRowClasses}
{...rowProps}
aria-selected={selectedRows[index]}
Copy link
Contributor

@skvale skvale Jul 10, 2020

Choose a reason for hiding this comment

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

If we know the first item in the row is a checkbox, can we just do

aria-selected={row?.rowData?[0]?.props.checked}

Otherwise we'd have duplicated selected logic here and for the consumer, in this case Table.stories.js. They could get out of sync. Such as if they wanted to render a row pre-selected this component would not account for that.

@@ -77,7 +83,7 @@ const Checkbox = React.forwardRef(({
className={labelClasses}
disabled={disabled}
htmlFor={checkId}>
{children}
{checkboxChildren}
Copy link
Contributor

@skvale skvale Jul 10, 2020

Choose a reason for hiding this comment

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

on a related note, is children a required prop? I saw this warning in our Table stories

Warning: Failed prop type: The prop `children` is marked as required in `Checkbox`, but its value is `undefined`.
    in Checkbox (created by storyFn)
    in storyFn
    in ErrorBoundary

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 it was me that set it to required - from my memory it was to enforce the checkbox having a label

Copy link
Contributor

Choose a reason for hiding this comment

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

Unless they change the design for the table with checkbox, we need to mark children as not required and provide an aria-label alternative. Or do a custom prop so we require either children or an aria-label.

@@ -161,8 +152,6 @@ Dialog.propTypes = {
actions: PropTypes.arrayOf(PropTypes.node).isRequired,
/** Localized text for the heading */
title: PropTypes.string.isRequired,
/** CSS class(es) to add to the dialog backdrop */
backdropClassName: PropTypes.string,
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 we should still keep the ability to put a class on the backdrop even though fd-overlay was removed

@@ -34,7 +34,7 @@ Icon.propTypes = {
/** CSS class(es) to add to the element */
className: PropTypes.string,
/** Size of the component: 's', 'm', 'l', 'xl' */
size: PropTypes.oneOf(ICON_SIZES)
size: PropTypes.oneOf(Object.keys(ICON_SIZES))
Copy link
Contributor

Choose a reason for hiding this comment

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

let's choose a default size

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually let's not so it just gets the whatever font-size - can we make that prop conditional so we don't have undefined when it's not specified though

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'm a little confused here—the markup seems to be fine when size is undefined (i.e. no inline styling applied) and there's no error. Is a conditional check still necessary?

Copy link
Contributor

Choose a reason for hiding this comment

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

Look at the diff for InputGroup:

<span
          className="sap-icon--globe"
          style={
            Object {
              "fontSize": undefined,
            }
          }
        />

It should probably not even add the style prop if fontSize is undefined instead of adding that

@@ -158,6 +157,7 @@ exports[`Storyshots Component API/SearchInput Disabled 1`] = `
>
<div
className="fd-input-group--control fd-input-group"
onClick={[Function]}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it right for the onClick to be on a different element than the focus and blur?

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 FormValidationOverlay has focus and blur events for showing the validation message. The onClick is from the Popover adding click handling and other attributes to the control component; these props used to be spread to the overlay's base div. But this would be problematic because then the overlay would get all the aria attributes. So I thought it made more sense for FormValidationOverlay to pass down all props spread to it to the control component instead, as if there was no overlay. Not sure if there is a case for spreading props to it.

Either way, it works the same.

Copy link
Contributor

@jbadan jbadan left a comment

Choose a reason for hiding this comment

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

Huge undertaking!!! All my concerns have been addressed ⛵

@jacobdevera jacobdevera merged commit 695aac4 into master Jul 14, 2020
@jacobdevera jacobdevera deleted the feat/styles-upgrade branch July 14, 2020 16:26
@jbadan jbadan mentioned this pull request Sep 1, 2020
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.

5 participants