Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/react-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"tslib": "^2.5.0"
},
"devDependencies": {
"@patternfly/patternfly": "5.0.0-alpha.33",
"@patternfly/patternfly": "5.0.0-alpha.37",
"@rollup/plugin-commonjs": "^24.0.0",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-replace": "^5.0.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-core/scripts/copyStyles.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ copySync(join(pfDir, 'assets/fonts'), join(stylesDir, 'assets/fonts'), {
// Copy css
const baseCssFiles = {
'base.css': 'patternfly-base.css',
'base-no-reset.css': 'patternfly-base-no-reset.css'
'base-no-reset.css': 'patternfly-base-no-globals.css'
};

for (const [targetCss, baseCss] of Object.entries(baseCssFiles)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import * as React from 'react';
import cssVar from '@patternfly/react-tokens/dist/esm/c_background_image_BackgroundImage';
import cssVarName2x from '@patternfly/react-tokens/dist/esm/c_background_image_BackgroundImage_2x';
import cssVarNameSm from '@patternfly/react-tokens/dist/esm/c_background_image_BackgroundImage_sm';
import cssVarNameSm2x from '@patternfly/react-tokens/dist/esm/c_background_image_BackgroundImage_sm_2x';
import cssVarNameLg from '@patternfly/react-tokens/dist/esm/c_background_image_BackgroundImage_lg';
import cssVarNameFilter from '@patternfly/react-tokens/dist/esm/c_background_image_Filter';
// Commented imports that no longer exist. This component will be updated with issue #8452 resolution

// import cssVar from '@patternfly/react-tokens/dist/esm/c_background_image_BackgroundImage';
// import cssVarName2x from '@patternfly/react-tokens/dist/esm/c_background_image_BackgroundImage_2x';
// import cssVarNameSm from '@patternfly/react-tokens/dist/esm/c_background_image_BackgroundImage_sm';
// import cssVarNameSm2x from '@patternfly/react-tokens/dist/esm/c_background_image_BackgroundImage_sm_2x';
// import cssVarNameLg from '@patternfly/react-tokens/dist/esm/c_background_image_BackgroundImage_lg';
// import cssVarNameFilter from '@patternfly/react-tokens/dist/esm/c_background_image_Filter';
import { css } from '@patternfly/react-styles';
import styles from '@patternfly/react-styles/css/components/BackgroundImage/background-image';

Expand All @@ -16,17 +18,17 @@ export interface BackgroundImageSrcMap {
lg: string;
}

const defaultFilter = (
<filter>
<feColorMatrix type="matrix" values="1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1 0"></feColorMatrix>
<feComponentTransfer colorInterpolationFilters="sRGB" result="duotone">
<feFuncR type="table" tableValues="0.086274509803922 0.43921568627451"></feFuncR>
<feFuncG type="table" tableValues="0.086274509803922 0.43921568627451"></feFuncG>
<feFuncB type="table" tableValues="0.086274509803922 0.43921568627451"></feFuncB>
<feFuncA type="table" tableValues="0 1"></feFuncA>
</feComponentTransfer>
</filter>
);
// const defaultFilter = (
// <filter>
// <feColorMatrix type="matrix" values="1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1 0"></feColorMatrix>
// <feComponentTransfer colorInterpolationFilters="sRGB" result="duotone">
// <feFuncR type="table" tableValues="0.086274509803922 0.43921568627451"></feFuncR>
// <feFuncG type="table" tableValues="0.086274509803922 0.43921568627451"></feFuncG>
// <feFuncB type="table" tableValues="0.086274509803922 0.43921568627451"></feFuncB>
// <feFuncA type="table" tableValues="0 1"></feFuncA>
// </feComponentTransfer>
// </filter>
// );

export interface BackgroundImageProps extends Omit<React.HTMLProps<HTMLDivElement>, 'src'> {
/** Additional classes added to the background. */
Expand All @@ -37,41 +39,42 @@ export interface BackgroundImageProps extends Omit<React.HTMLProps<HTMLDivElemen
src: string | BackgroundImageSrcMap;
}

let filterCounter = 0;
// let filterCounter = 0;

export const BackgroundImage: React.FunctionComponent<BackgroundImageProps> = ({
className,
src,
filter = defaultFilter,
// src,
// filter = defaultFilter,
...props
}: BackgroundImageProps) => {
const getUrlValue = (size: keyof BackgroundImageSrcMap) => {
if (typeof src === 'string') {
return `url(${src})`;
} else if (typeof src === 'object') {
return `url(${src[size]})`;
}
}: BackgroundImageProps) =>
// const getUrlValue = (size: keyof BackgroundImageSrcMap) => {
// if (typeof src === 'string') {
// return `url(${src})`;
// } else if (typeof src === 'object') {
// return `url(${src[size]})`;
// }

return '';
};
// return '';
// };

const filterNum = React.useMemo(() => filterCounter++, []);
const filterId = `patternfly-background-image-filter-overlay${filterNum}`;
const style = {
[cssVar.name]: getUrlValue('xs'),
[cssVarName2x.name]: getUrlValue('xs2x'),
[cssVarNameSm.name]: getUrlValue('sm'),
[cssVarNameSm2x.name]: getUrlValue('sm2x'),
[cssVarNameLg.name]: getUrlValue('lg'),
[cssVarNameFilter.name]: `url(#${filterId})`
} as React.CSSProperties;
// const filterNum = React.useMemo(() => filterCounter++, []);
// const filterId = `patternfly-background-image-filter-overlay${filterNum}`;
// const style = {
// [cssVar.name]: getUrlValue('xs'),
// [cssVarName2x.name]: getUrlValue('xs2x'),
// [cssVarNameSm.name]: getUrlValue('sm'),
// [cssVarNameSm2x.name]: getUrlValue('sm2x'),
// [cssVarNameLg.name]: getUrlValue('lg'),
// [cssVarNameFilter.name]: `url(#${filterId})`
// } as React.CSSProperties;

return (
<div className={css(styles.backgroundImage, className)} style={style} {...props}>
(
// TODO: removed inline style add it back with issue #8452 resolution. Also commented out the "React.cloneElement(filter, { id: filterId })} "
<div className={css(styles.backgroundImage, className)} {...props}>
<svg xmlns="http://www.w3.org/2000/svg" className="pf-c-background-image__filter" width="0" height="0">
{React.cloneElement(filter, { id: filterId })}
{/* {React.cloneElement(filter, { id: filterId })} */}
</svg>
</div>
);
};
)
;
BackgroundImage.displayName = 'BackgroundImage';
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,14 @@ exports[`BackgroundImage 1`] = `
<DocumentFragment>
<div
class="pf-c-background-image"
style="--pf-c-background-image--BackgroundImage: url(/assets/images/pfbg_576.jpg); --pf-c-background-image--BackgroundImage-2x: url(/assets/images/pfbg_576@2x.jpg); --pf-c-background-image--BackgroundImage--sm: url(/assets/images/pfbg_768.jpg); --pf-c-background-image--BackgroundImage--sm-2x: url(/assets/images/pfbg_768@2x.jpg); --pf-c-background-image--BackgroundImage--lg: url(/assets/images/pfbg_1200.jpg); --pf-c-background-image--Filter: url(#patternfly-background-image-filter-overlay0);"
src="[object Object]"
>
<svg
class="pf-c-background-image__filter"
height="0"
width="0"
xmlns="http://www.w3.org/2000/svg"
>
<filter
id="patternfly-background-image-filter-overlay0"
>
<fecolormatrix
type="matrix"
values="1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1 0"
/>
<fecomponenttransfer
color-interpolation-filters="sRGB"
result="duotone"
>
<fefuncr
tableValues="0.086274509803922 0.43921568627451"
type="table"
/>
<fefuncg
tableValues="0.086274509803922 0.43921568627451"
type="table"
/>
<fefuncb
tableValues="0.086274509803922 0.43921568627451"
type="table"
/>
<fefunca
tableValues="0 1"
type="table"
/>
</fecomponenttransfer>
</filter>
</svg>
/>
</div>
</DocumentFragment>
`;
Expand All @@ -50,44 +20,14 @@ exports[`allows passing in a single string as the image src 1`] = `
<DocumentFragment>
<div
class="pf-c-background-image"
style="--pf-c-background-image--BackgroundImage: url(/assets/images/pfbg_1200.jpg); --pf-c-background-image--BackgroundImage-2x: url(/assets/images/pfbg_1200.jpg); --pf-c-background-image--BackgroundImage--sm: url(/assets/images/pfbg_1200.jpg); --pf-c-background-image--BackgroundImage--sm-2x: url(/assets/images/pfbg_1200.jpg); --pf-c-background-image--BackgroundImage--lg: url(/assets/images/pfbg_1200.jpg); --pf-c-background-image--Filter: url(#patternfly-background-image-filter-overlay1);"
src="/assets/images/pfbg_1200.jpg"
>
<svg
class="pf-c-background-image__filter"
height="0"
width="0"
xmlns="http://www.w3.org/2000/svg"
>
<filter
id="patternfly-background-image-filter-overlay1"
>
<fecolormatrix
type="matrix"
values="1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1 0"
/>
<fecomponenttransfer
color-interpolation-filters="sRGB"
result="duotone"
>
<fefuncr
tableValues="0.086274509803922 0.43921568627451"
type="table"
/>
<fefuncg
tableValues="0.086274509803922 0.43921568627451"
type="table"
/>
<fefuncb
tableValues="0.086274509803922 0.43921568627451"
type="table"
/>
<fefunca
tableValues="0 1"
type="table"
/>
</fecomponenttransfer>
</filter>
</svg>
/>
</div>
</DocumentFragment>
`;
2 changes: 1 addition & 1 deletion packages/react-core/src/components/Icon/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface IconComponentProps extends Omit<React.HTMLProps<HTMLSpanElement
/** Size of progress icon. Overrides the icon size set by the size property. */
progressIconSize?: 'sm' | 'md' | 'lg' | 'xl';
/** Status color of the icon */
status?: 'default' | 'info' | 'success' | 'warning' | 'danger';
status?: 'custom' | 'info' | 'success' | 'warning' | 'danger';
/** Indicates the icon is inline and should inherit the text font size and color. Overriden by size and iconSize properties. */
isInline?: boolean;
/** Indicates the icon is in progress. Setting this property to true will swap the icon with the progressIcon. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ test('check icon without size', () => {
expect(Array.from(iconContainer?.classList || []).some(c => /pf-m-*/.test(c))); // Check no modifier classes have been added
});

Object.values(['default', 'info', 'success', 'warning', 'danger']).forEach(status => {
Object.values(['custom', 'info', 'success', 'warning', 'danger']).forEach(status => {
test(`sets status modifier successfully - ${status}`, () => {
render(
<Icon status={status as 'default' | 'info' | 'success' | 'warning' | 'danger'} title={`${status}-icon`}>
<Icon status={status as 'custom' | 'info' | 'success' | 'warning' | 'danger'} title={`${status}-icon`}>
<CheckIcon />
</Icon>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const IconStatus: React.FunctionComponent = () => (
<Icon status="info">
<InfoCircleIcon />
</Icon>
<Icon status="default">
<Icon status="custom">
<BellIcon />
</Icon>
</React.Fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,14 @@ exports[`check loginpage example against snapshot 1`] = `
<div
alt="Pf-background"
class="pf-c-background-image"
style="--pf-c-background-image--BackgroundImage: url(Background src); --pf-c-background-image--BackgroundImage-2x: url(Background src); --pf-c-background-image--BackgroundImage--sm: url(Background src); --pf-c-background-image--BackgroundImage--sm-2x: url(Background src); --pf-c-background-image--BackgroundImage--lg: url(Background src); --pf-c-background-image--Filter: url(#patternfly-background-image-filter-overlay0);"
src="Background src"
>
<svg
class="pf-c-background-image__filter"
height="0"
width="0"
xmlns="http://www.w3.org/2000/svg"
>
<filter
id="patternfly-background-image-filter-overlay0"
>
<fecolormatrix
type="matrix"
values="1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1 0"
/>
<fecomponenttransfer
color-interpolation-filters="sRGB"
result="duotone"
>
<fefuncr
tableValues="0.086274509803922 0.43921568627451"
type="table"
/>
<fefuncg
tableValues="0.086274509803922 0.43921568627451"
type="table"
/>
<fefuncb
tableValues="0.086274509803922 0.43921568627451"
type="table"
/>
<fefunca
tableValues="0 1"
type="table"
/>
</fecomponenttransfer>
</filter>
</svg>
/>
</div>
<div
class="pf-c-login"
Expand Down
2 changes: 1 addition & 1 deletion packages/react-core/src/components/Modal/ModalContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export const ModalContent: React.FunctionComponent<ModalContentProps> = ({
className={css(
className,
isVariantIcon(titleIconVariant) &&
modalStyles.modifiers[titleIconVariant as 'success' | 'warning' | 'info' | 'danger' | 'default']
modalStyles.modifiers[titleIconVariant as 'success' | 'warning' | 'info' | 'danger' | 'custom']
)}
variant={variant}
position={position}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface NotificationDrawerListItemProps extends React.HTMLProps<HTMLLIE
/** Tab index for the list item */
tabIndex?: number;
/** Variant indicates the severity level */
variant?: 'default' | 'success' | 'danger' | 'warning' | 'info';
variant?: 'custom' | 'success' | 'danger' | 'warning' | 'info';
}

export const NotificationDrawerListItem: React.FunctionComponent<NotificationDrawerListItemProps> = ({
Expand All @@ -27,7 +27,7 @@ export const NotificationDrawerListItem: React.FunctionComponent<NotificationDra
// eslint-disable-next-line @typescript-eslint/no-unused-vars
onClick = (event: React.MouseEvent) => undefined as any,
tabIndex = 0,
variant = 'default',
variant = 'custom',
...props
}: NotificationDrawerListItemProps) => {
const onKeyDown = (event: React.KeyboardEvent) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`NotificationDrawerListItem renders with PatternFly Core styles 1`] = `
<DocumentFragment>
<li
class="pf-c-notification-drawer__list-item pf-m-hoverable pf-m-default"
class="pf-c-notification-drawer__list-item pf-m-hoverable pf-m-custom"
tabindex="0"
/>
</DocumentFragment>
Expand Down
2 changes: 1 addition & 1 deletion packages/react-core/src/components/Popover/Popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export interface PopoverProps {
}

const alertStyle = {
default: styles.modifiers.default,
default: styles.modifiers.custom,
info: styles.modifiers.info,
success: styles.modifiers.success,
warning: styles.modifiers.warning,
Expand Down
2 changes: 1 addition & 1 deletion packages/react-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"test:a11y": "patternfly-a11y --config patternfly-a11y.config"
},
"dependencies": {
"@patternfly/patternfly": "5.0.0-alpha.33",
"@patternfly/patternfly": "5.0.0-alpha.37",
"@patternfly/react-charts": "^7.0.0-alpha.13",
"@patternfly/react-code-editor": "^5.0.0-alpha.51",
"@patternfly/react-core": "^5.0.0-alpha.50",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-icons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@fortawesome/free-brands-svg-icons": "^5.14.0",
"@fortawesome/free-regular-svg-icons": "^5.14.0",
"@fortawesome/free-solid-svg-icons": "^5.14.0",
"@patternfly/patternfly": "5.0.0-alpha.33",
"@patternfly/patternfly": "5.0.0-alpha.37",
"fs-extra": "^11.1.0",
"glob": "^7.1.2",
"rimraf": "^2.6.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('Notification Drawer Basic Demo Test', () => {
.should('have.class', 'pf-m-success');
cy.get('.pf-c-notification-drawer__list-item')
.last()
.should('have.class', 'pf-m-default');
.should('have.class', 'pf-m-custom');
});

it('Verify timestamp in list items', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ import {
Toolbar,
ToolbarContent,
ToolbarGroup,
ToolbarItem,
ContextSelector,
ContextSelectorItem
ToolbarItem
} from '@patternfly/react-core';
import { ContextSelector, ContextSelectorItem } from '@patternfly/react-core/deprecated';
import {
Dropdown as DropdownDeprecated,
DropdownToggle,
Expand Down
Loading