-
Notifications
You must be signed in to change notification settings - Fork 30
Fix NotAuthorized default actions and clean the code #100
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
Changes from all commits
d6b933a
a0c0b6e
7394672
558d525
cd36e9e
325e09a
8f150df
c4c0bea
f935fb7
a3f8016
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import React from 'react'; | ||
| import NotAuthorized from "@patternfly/react-component-groups/dist/dynamic/NotAuthorized"; | ||
|
|
||
| export const BasicExample: React.FunctionComponent = () => ( | ||
| <NotAuthorized | ||
| description="Description text" | ||
| serviceName="Demo bundle" | ||
| prevPageButtonText="Go to previous page" | ||
| /> | ||
| ); | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,41 +1,32 @@ | ||
| import React from 'react'; | ||
| import { Button, ButtonProps, ButtonVariant } from '@patternfly/react-core'; | ||
| import { CloseIcon } from '@patternfly/react-icons'; | ||
| import clsx from 'clsx'; | ||
| import { createUseStyles } from 'react-jss'; | ||
| import clsx from 'clsx'; | ||
|
|
||
| const useStyles = createUseStyles({ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jessiehuff does removing the padding on this component keep the click area large enough to meet a11y standards? And I think that in general, to keep these components compatible with right-to-left languages, we might want to avoid using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nicolethoen good call on the RTL support. There are logical values for
We don't have a global modifier for this. We do have float utility classes though, and that utility stylesheet is lightweight (https://unpkg.com/browse/@patternfly/patternfly@latest/utilities/Float/float.css) if that's an option, though it's worth noting that our utility classes are not using logical values when they probably should. I opened an issue for that here patternfly/patternfly#6273.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Based on WCAG guidelines, the clickable area should be 44 x 44 pixels. It looks like removing the padding makes it 48 x 36 so we should probably at least increase the height to 44 pixels.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think we are going to need a designer to step in at some point to commit a review once or twice a months of new components. with the changes in v6 I can see this giving us headaches. Fortunately we are small enough right now w can fix stuff. |
||
| '& float-right': { | ||
| float: 'right' | ||
| closeButton: { | ||
| float: 'inline-end', | ||
| padding: '10px 14px' | ||
| }, | ||
| '& no-padding': { | ||
| padding: 0 | ||
| } | ||
| }); | ||
|
|
||
| export interface CloseButtonProps extends ButtonProps { | ||
| /** Additional styling to apply to the close button. */ | ||
| additionalClassName?: string; | ||
| /** Aria label for accessibility */ | ||
| ariaLabel?: string; | ||
| /** Data test id used for testing. */ | ||
| /** Data test ID used for testing. */ | ||
| dataTestID?: string; | ||
| /** Callback when the button is clicked*/ | ||
| onClick: (event: any) => void; | ||
| } | ||
| }; | ||
|
|
||
| const CloseButton: React.FunctionComponent<CloseButtonProps> = ({ | ||
| additionalClassName, | ||
| ariaLabel, | ||
| className, | ||
| dataTestID, | ||
| onClick, | ||
| ...props | ||
| }: CloseButtonProps) => { | ||
| const classes = useStyles(); | ||
| return ( | ||
| <Button | ||
| aria-label={ariaLabel || 'Close'} | ||
| className={clsx(classes, additionalClassName)} | ||
| aria-label={props['aria-label'] || 'Close'} | ||
| className={clsx(classes.closeButton, className)} | ||
| data-test-id={dataTestID} | ||
| onClick={onClick} | ||
| variant={ButtonVariant.plain} | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.