-
Notifications
You must be signed in to change notification settings - Fork 77
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
Conversation
Deploy preview for fundamental-react ready! Built with commit 00de77f |
src/utils/constants.js
Outdated
export const ICON_SIZES = { | ||
's': '12px', | ||
'm': '16px', | ||
'l': '20px', | ||
'xl': '24px' | ||
}; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
src/Table/Table.js
Outdated
displayRows = row.rowData.splice(1, row.rowData.length); | ||
} | ||
|
||
return ( | ||
<tr | ||
className={tableRowClasses} | ||
{...rowProps} | ||
aria-selected={selectedRows[index]} |
There was a problem hiding this comment.
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} |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
.
src/Dialog/Dialog.js
Outdated
@@ -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, |
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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]} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this 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 ⛵
Description
Affected Components
combobox
,aria-haspopup
changed tolistbox
, fixingaria-disabled
andaria-readonly
fd-checkbox__text
class added for ellipsis overflowbackdropClassName
, remove overlay classesfd-bar—cosy
renamed tofd-bar—cozy
; new icon for ‘choose date’ buttonis-expanded
class added