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: update fundamental-styles to 0.12.0-rc.44 #1203

Merged
merged 13 commits into from
Sep 15, 2020
Merged

Conversation

jacobdevera
Copy link
Contributor

@jacobdevera jacobdevera commented Sep 8, 2020

Description

BREAKING CHANGE

  • Implements breaking changes from fundamental-styles up to 0.12.0-rc.44
    • rc.21 - moving icons from pseudoelements to <i> tag in button
      • icons now in a <i> tag in Icon and button text moved into a <span> with class ‘fd-button__text’
  • adds iconBeforeText, iconProps, and textClassName prop to Button
  • adds ariaHidden and ariaLabel props to Icon

@jacobdevera jacobdevera self-assigned this Sep 8, 2020
@netlify
Copy link

netlify bot commented Sep 8, 2020

Deploy preview for fundamental-react ready!

Built with commit 410e943

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

@jacobdevera jacobdevera marked this pull request as ready for review September 9, 2020 22:59
/>
>
<i
className="sap-icon--navigation-left-arrow"
Copy link
Contributor

Choose a reason for hiding this comment

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

Do all these icons need aria-hidden attributes like we do in widgets?

{!readOnly && <span className={triggerClassNames} />}
{!readOnly &&
<span className={triggerClassNames}>
<i className='sap-icon--slim-arrow-down' />
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this use the Icon component + does it need some sort of aria-label?

{children}
{iconBeforeText && glyph && <i aria-hidden='true' className={iconClasses} />}
{children && <span className={buttonTextClasses}>{children}</span>}
{!iconBeforeText && glyph && <i aria-hidden='true' className={iconClasses} />}
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here, can these use the Icon component + remove import of Icon.css?

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.

Can we reuse the Icon component where possible + augment it to have warnings like in widgets for aria-labels/aria-hidden?

src/Icon/Icon.js Outdated
@@ -22,9 +22,13 @@ const Icon = React.forwardRef(({ glyph, size, className, ...props }, ref) => {
style = { fontSize: ICON_SIZES[size] };
}

const Tag = isInButton ? 'i' : 'span';
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 was hesitant to use the Icon component because it uses a span instead of i. Should we go back to fundamental-styles so that all icons use an i as in nui-widgets?

Copy link
Contributor

Choose a reason for hiding this comment

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

After the discussion this morning, I think they're in the process of moving all icons to their own <i> tag- SAP/fundamental-styles#1604

We can probably just go ahead and use i tags since it doesn't cause any styling issues and then styles will catch up. Up to you though

Copy link
Contributor

Choose a reason for hiding this comment

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

👍 If we could use the Icon component and use i tags to get ahead of it where possible that would save us time down the line.

@@ -53,7 +53,7 @@ export const types = () => (

types.storyName = 'Types';

/** Button can have an icon with text or just and icon. */
/** Button can have an icon with text or just an icon. Be sure to use an `aria-label` if there is no text. */

Copy link
Member

Choose a reason for hiding this comment

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

Can we add aria-label to the

<Button glyph='alert' option='emphasized' />

in this file.

ariaHidden
glyph={glyph} />
) : null;

Copy link
Contributor

Choose a reason for hiding this comment

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

Does it work to just do something like:

const renderIcon = () => {
return ( glyph && <Icon props here />
)

}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

lint complains Declare only one React component per file

Not sure if it's cleaner to disable it / if we want to 🤷‍♂️

Copy link
Contributor

Choose a reason for hiding this comment

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

Eh, I think it's fine the way you have it

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.

Sorry, I didn't realize I had left this blocked

@jacobdevera jacobdevera merged commit 0c0cce7 into master Sep 15, 2020
@jacobdevera jacobdevera deleted the feat/styles-upgrade branch September 15, 2020 20:00
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.

None yet

4 participants