Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 2 additions & 3 deletions .github/promote.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc

#if [[ ! -z "${PATTERNFLY_VERSION}" ]]; then
# echo "Updating to @patternfly/patternfly: ${PATTERNFLY_VERSION}"
# npm pkg set dependencies.@patternfly/patternfly=${PATTERNFLY_VERSION} --workspace @patternfly/react-docs
# npm pkg set devDependencies.@patternfly/patternfly=${PATTERNFLY_VERSION} --workspace @patternfly/react-core --workspace @patternfly/react-styles --workspace @patternfly/react-tokens --workspace @patternfly/react-icons
# npm pkg set dependencies.@patternfly/patternfly=${PATTERNFLY_VERSION} --workspace @rh-felt/react-docs
# npm pkg set devDependencies.@patternfly/patternfly=${PATTERNFLY_VERSION} --workspace @rh-felt/react-core --workspace @rh-felt/react-styles --workspace @rh-felt/react-tokens --workspace @rh-felt/react-icons
#fi

# publish to npm
Expand All @@ -27,4 +27,3 @@ yarn run lerna version preminor --force-publish --conventional-commits --no-priv
# dry run
# yarn run lerna version --conventional-commits --conventional-graduate --no-private --yes --no-git-tag-version --no-push


2 changes: 1 addition & 1 deletion .github/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ PR_NUM=${LOG:1}
yarn run lerna publish prerelease --preid=prerelease --dist-tag=prerelease --yes 2>&1 | tee lerna-output.txt

# use lerna command below for dry run
#yarn run lerna version prerelease --preid=prerelease --yes --no-git-tag-version --no-push | tee lerna-output.txt
# yarn run lerna version prerelease --preid=prerelease --dist-tag=prerelease --yes --no-git-tag-version --no-push | tee lerna-output.txt

if grep -i "Successfully published" lerna-output.txt; # Leave a Github comment
then
Expand Down
6 changes: 3 additions & 3 deletions .github/upload-preview.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ if (!uploadFolder) {
}

const uploadFolderName = path.basename(uploadFolder);
let uploadURL = `pf-react-${prnum ? `pr-${prnum}` : prbranch}`.replace(/[/|.]/g, '-');
let uploadURL = `rh-felt-react-${prnum ? `pr-${prnum}` : prbranch}`.replace(/[/|.]/g, '-');

switch (uploadFolderName) {
case 'coverage':
uploadURL += '-a11y.surge.sh';
break;
case 'public':
if (!prnum && prbranch === 'main') {
uploadURL = 'pf-react-staging.patternfly.org';
if (!prnum && prbranch === 'felt-v1') {
uploadURL = 'rh-felt-react-staging.patternfly.org';

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

update to use surge

} else {
uploadURL += '.surge.sh';
}
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Release
on:
push:
branches:
- main
- felt-v1
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand Down Expand Up @@ -41,4 +41,3 @@ jobs:
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GH_PR_TOKEN: ${{ secrets.GH_PR_TOKEN }}

38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
# PatternFly React
# Felt React

[![lerna](https://img.shields.io/badge/maintained%20with-lerna-green.svg?style=for-the-badge)](https://lernajs.io/)
[![PatternFly npm badge](https://img.shields.io/npm/v/@patternfly/react-core.svg?label=PF%20Core&style=for-the-badge)](https://www.npmjs.com/package/@patternfly/react-core)
[![Felt npm badge](https://img.shields.io/npm/v/@rh-felt/react-core.svg?label=PF%20Core&style=for-the-badge)](https://www.npmjs.com/package/@rh-felt/react-core)

This project provides a set of React components for the [PatternFly project](https://patternfly.org).
This project provides a set of React components for the [Felt project](https://patternfly.org).

**Community:** [PatternFly website](https://www.patternfly.org) | [Slack](https://patternfly.slack.com) | [Medium](https://medium.com/patternfly) | [Mailing list](https://www.redhat.com/mailman/listinfo/patternfly)

### Table of contents
1. [PatternFly React packages](#patternfly-react-packages)
1. [Felt React packages](#felt-react-packages)
2. [Setup](#Setup)
3. [Contribution guidelines](#Contribution-guidelines)
4. [License](#License)

Using PatternFly 3? Take a look at the [PatternFly 3 React component information](https://github.com/patternfly/patternfly-react/blob/patternfly-3/README.md).

### PatternFly React packages
### Felt React packages

| Package link | Description |
| --- | --- |
| **:blue_heart: Core packages** |
|   [@patternfly/react-core](./packages/react-core/README.md) | Core set of components |
|   [@patternfly/react-table](./packages/react-table/README.md) | Table components |
|   [@patternfly/react-charts](./packages/react-charts/README.md) | Chart components
|   [@patternfly/react-icons](./packages/react-icons/README.md) | Icon components |
|   [@patternfly/react-styles](./packages/react-styles/README.md) | PatternFly CSS styles |
|   [@patternfly/react-tokens](./packages/react-tokens/README.md) | PatternFly CSS variable tokens |
|   [@rh-felt/react-core](./packages/react-core/README.md) | Core set of components |
|   [@rh-felt/react-table](./packages/react-table/README.md) | Table components |
|   [@rh-felt/react-charts](./packages/react-charts/README.md) | Chart components
|   [@rh-felt/react-icons](./packages/react-icons/README.md) | Icon components |
|   [@rh-felt/react-styles](./packages/react-styles/README.md) | Felt CSS styles |
|   [@rh-felt/react-tokens](./packages/react-tokens/README.md) | Felt CSS variable tokens |
| **:yellow_heart: Extension packages** |
|   [@patternfly/react-log-viewer](https://github.com/patternfly/react-log-viewer/blob/main/README.md) | Virtualized log viewer component |
|   [@patternfly/react-catalog-view-extension](https://github.com/patternfly/react-catalog-view/blob/main/README.md) | Catalog view extension |
|   [@patternfly/react-topology](https://github.com/patternfly/react-topology/blob/main/README.md) | Topology components |
| **:open_file_folder: Supporting packages** |
|   [@patternfly/react-docs](./packages/react-docs/README.md) | Gatsby documentation site for components |
|   [@patternfly/react-integration](./packages/react-integration/README.md) | Cypress integration tests |
|   [@rh-felt/react-docs](./packages/react-docs/README.md) | Gatsby documentation site for components |
|   [@rh-felt/react-integration](./packages/react-integration/README.md) | Cypress integration tests |
| **:x: Deprecated packages** |
|   [@patternfly/react-virtualized-extension](https://github.com/patternfly/react-virtualized-extension/blob/main/README.md) | Table and list row virtualization extension |

Expand Down Expand Up @@ -67,26 +67,26 @@ If you want to start with your existing project, skip to [Install and configure
#### Install and configure PatternFly React
* Using npm, run the following command to install:
```
npm install @patternfly/react-core --save
npm install @rh-felt/react-core --save
```

**OR**

* Using yarn, run the following command to install:
```
yarn add @patternfly/react-core
yarn add @rh-felt/react-core
```

Once the library is installed, use the specific setup instructions for that library to access the components it contains. These can be found in the readme for each [library](#patternfly-react-packages).
Once the library is installed, use the specific setup instructions for that library to access the components it contains. These can be found in the readme for each [library](#felt-react-packages).

#### Configure PatternFly styling
PatternFly uses the [`@patternfly/react-styles` package](https://www.npmjs.com/package/@patternfly/react-styles) as a translation layer to reference the styles contained in the PatternFly HTML/CSS library. When developing with Patternfly React, include the following import at the base level of your application to pull in PatternFly's styling:
PatternFly uses the [`@rh-felt/react-styles` package](https://www.npmjs.com/package/@rh-felt/react-styles) as a translation layer to reference the styles contained in the PatternFly HTML/CSS library. When developing with Patternfly React, include the following import at the base level of your application to pull in PatternFly's styling:

```
import '@patternfly/react-core/dist/styles/base.css';
import '@rh-felt/react-core/dist/styles/base.css';
```

Importing CSS directly from the PatternFly HTML/CSS library while using PatternFly React may result in duplicated stylesheets in the browser as PatternFly React already pulls in styles internally via `@patternfly/react-styles`.
Importing CSS directly from the PatternFly HTML/CSS library while using PatternFly React may result in duplicated stylesheets in the browser as PatternFly React already pulls in styles internally via `@rh-felt/react-styles`.

### Contribution guidelines
All React contributors must first be [PatternFly community contributors](https://www.patternfly.org/get-started/contribute/contributing-to-patternfly). If you're already a PatternFly community contributor, check out the [React contribution guidelines](https://github.com/patternfly/patternfly-react/tree/main/CONTRIBUTING.md) to make React contributions.
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
}
},
"version": "independent",
"allowBranch": ["main", "v4", "5.0.x", "6.3.x", "v5"],
"allowBranch": ["main", "felt-v1", "v4", "5.0.x", "6.3.x", "v5"],
"packages": ["packages/*", "packages/react-integration/demo-app-ts"],
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
}
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@patternfly/react-lerna-root",
"name": "@rh-felt/react-lerna-root",
"private": true,
"version": "0.0.0",
"description": "This library provides a set of common React components for use with the PatternFly reference implementation.",
"description": "This library provides a set of common React components for use with the Felt reference implementation.",
"repository": {
"type": "git",
"url": "https://github.com/patternfly/patternfly-react.git"
Expand Down Expand Up @@ -86,7 +86,7 @@
"build:cjs": "tsc --build --verbose packages/tsconfig.cjs.json",
"build:esm": "tsc --build --verbose packages/tsconfig.json",
"build:integration": "lerna run build --scope=demo-app-ts --stream",
"build:docs": "yarn workspace @patternfly/react-docs build:docs",
"build:docs": "yarn workspace @rh-felt/react-docs build:docs",
"build:generate": "lerna run generate --parallel --stream",
"build:subpaths": "lerna run subpaths --parallel --stream",
"build:umd": "lerna run build:umd --parallel --stream",
Expand All @@ -101,17 +101,17 @@
"lint:tests": "yarn lint packages/*/src/components/*/__tests__/*.test.*",
"lint:publication": "yarn workspaces foreach --all --no-private --parallel exec publint --strict",
"postinstall": "ts-patch install -s && husky",
"serve:docs": "yarn workspace @patternfly/react-docs serve",
"serve:docs": "yarn workspace @rh-felt/react-docs serve",
"serve:integration": "lerna run preview --scope=demo-app-ts",
"start": "yarn build && concurrently --kill-others \"yarn watch\" \"yarn workspace @patternfly/react-docs develop\"",
"start": "yarn build && concurrently --kill-others \"yarn watch\" \"yarn workspace @rh-felt/react-docs develop\"",
"start:cypress": "lerna run cypress:open",
"start:demo-app": "lerna run dev --scope=demo-app-ts --stream",
"test": "TZ=EST LC_ALL=en_US.UTF8 jest packages",
"test:a11y": "lerna run test:a11y --stream",
"test:integration": "yarn workspace @patternfly/react-integration test:integration",
"test:integration": "yarn workspace @rh-felt/react-integration test:integration",
"uninstall": "find . -name node_modules -type d | xargs rm -rf",
"watch": "yarn build:esm --watch",
"screenshots": "yarn workspace @patternfly/react-docs screenshots"
"screenshots": "yarn workspace @rh-felt/react-docs screenshots"
},
"lint-staged": {
"*.md": "yarn lint:md --fix",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/**
* @param specifier module specifier
* @param moduleName module name (@patternfly/react-tokens or @patternfly/react-icons)
* @param moduleName module name (@patternfly or @rh-felt react-tokens/react-icons)
* @returns string of non-treeshaken import
*/
function makeImport(specifier, moduleName) {
if (moduleName.endsWith('createIcon') && moduleName.startsWith('@patternfly/react-icons')) {
return `import { ${specifier.local.name} } from '@patternfly/react-icons/dist/esm/createIcon';`;
if (moduleName.endsWith('createIcon') && /^@(patternfly|rh-felt)\/react-icons/.test(moduleName)) {
const scope = moduleName.split('/')[0];
return `import { ${specifier.local.name} } from '${scope}/react-icons/dist/esm/createIcon';`;
}
let res = `import ${specifier.local.name} from '`;
res += moduleName.replace(/\/dist\/(js|esm)/, '');
Expand Down Expand Up @@ -40,12 +41,12 @@ module.exports = {
create(context) {
return {
ImportDeclaration(node) {
if (/@patternfly\/react-(tokens|icons)(\/dist\/(js|esm))?/.test(node.source.value)) {
if (/@(patternfly|rh-felt)\/react-(tokens|icons)(\/dist\/(js|esm))?/.test(node.source.value)) {
const esmSpecifiers = node.specifiers.filter(
(specifier) =>
specifier.type === 'ImportSpecifier' &&
!(
node.source.value.startsWith('@patternfly/react-icons') &&
/^@(patternfly|rh-felt)\/react-icons/.test(node.source.value) &&
node.source.value.endsWith('/dist/esm/createIcon')
)
);
Expand Down
14 changes: 7 additions & 7 deletions packages/react-charts/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# @patternfly/react-charts
# @rh-felt/react-charts

This package provides PatternFly charting components for [PatternFly][patternfly].

### Installing

```sh
yarn add @patternfly/react-charts
yarn add @rh-felt/react-charts
yarn add victory
```

or

```sh
npm install @patternfly/react-charts --save
npm install @rh-felt/react-charts --save
npm install victory --save
```

Expand All @@ -27,13 +27,13 @@ Note that Victory is now an optional peer dependency, allowing future chart libr
It's strongly advised to use the PatternFly Base CSS in your whole project, or some components may diverge in appearance:

```js
import '@patternfly/react-core/dist/styles/base.css';
import '@rh-felt/react-core/dist/styles/base.css';
```

#### Example Component Usage

```js
import { Area } from '@patternfly/react-charts/victory';
import { Area } from '@rh-felt/react-charts/victory';

export default <Area />;

Expand Down Expand Up @@ -61,7 +61,7 @@ yarn install && yarn start

# Contributing Components

This library makes use of the babel plugin from [@patternfly/react-styles](../react-styles/README.md) to enable providing the CSS alongside the components. This removes the need for consumers to use (style|css|sass)-loaders. For any CSS not provided by core please use the `StyleSheet.create` utility from [@patternfly/react-styles](../react-styles/README.md). This will prevent collisions with any consumers, and allow the CSS to be bundled with the component.
This library makes use of the babel plugin from [@rh-felt/react-styles](../react-styles/README.md) to enable providing the CSS alongside the components. This removes the need for consumers to use (style|css|sass)-loaders. For any CSS not provided by core please use the `StyleSheet.create` utility from [@rh-felt/react-styles](../react-styles/README.md). This will prevent collisions with any consumers, and allow the CSS to be bundled with the component.

### Building

Expand All @@ -73,7 +73,7 @@ Note the build scripts for this are located in the root package.json under `yarn

### Testing

Testing is done at the root of this repo. To only run the @patternfly/react-charts tests:
Testing is done at the root of this repo. To only run the @rh-felt/react-charts tests:

```
yarn test packages/react-charts
Expand Down
10 changes: 5 additions & 5 deletions packages/react-charts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@patternfly/react-charts",
"version": "8.7.0-prerelease.4",
"name": "@rh-felt/react-charts",
"version": "0.0.1-prerelease.0",
"description": "This library provides a set of React chart components for use with the PatternFly reference implementation.",
"main": "dist/js/index.js",
"module": "dist/esm/index.js",
Expand All @@ -22,7 +22,7 @@
],
"publishConfig": {
"access": "public",
"tag": "prerelase"
"tag": "prerelease"
},
"repository": {
"type": "git",
Expand All @@ -39,8 +39,8 @@
},
"homepage": "https://github.com/patternfly/patternfly-react#readme",
"dependencies": {
"@patternfly/react-styles": "workspace:^",
"@patternfly/react-tokens": "workspace:^",
"@rh-felt/react-styles": "workspace:^",
"@rh-felt/react-tokens": "workspace:^",
"hoist-non-react-statics": "^3.3.2",
"lodash": "^4.17.23",
"tslib": "^2.8.1"
Expand Down
2 changes: 1 addition & 1 deletion packages/react-charts/single-packages.config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"packageName": "@patternfly/react-charts",
"packageName": "@rh-felt/react-charts",
"exclude": ["dist/esm/echarts/deprecated/index.js", "dist/esm/echarts/next/index.js", "dist/esm/victory/deprecated/index.js", "dist/esm/victory/next/index.js"]
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FunctionComponent } from 'react';
import { Charts } from '@patternfly/react-charts/echarts';
import { Charts } from '@rh-felt/react-charts/echarts';

import * as echarts from 'echarts/core';
import { LineChart } from 'echarts/charts';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FunctionComponent, useEffect, useRef, useState } from 'react';
import { Charts, ThemeColor } from '@patternfly/react-charts/echarts';
import { getResizeObserver } from '@patternfly/react-core';
import { Charts, ThemeColor } from '@rh-felt/react-charts/echarts';
import { getResizeObserver } from '@rh-felt/react-core';

import * as echarts from 'echarts/core';
import { LineChart } from 'echarts/charts';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FormEvent, FunctionComponent, useState } from 'react';
import { Charts, ThemeColor } from '@patternfly/react-charts/echarts';
import { Switch } from '@patternfly/react-core';
import { Charts, ThemeColor } from '@rh-felt/react-charts/echarts';
import { Switch } from '@rh-felt/react-core';

import * as echarts from 'echarts/core';
import { LineChart } from 'echarts/charts';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { FunctionComponent } from 'react';
import { getComputedStyleValue, getCustomTheme, Charts, ThemeColor } from '@patternfly/react-charts/echarts';
import { getComputedStyleValue, getCustomTheme, Charts, ThemeColor } from '@rh-felt/react-charts/echarts';

import * as echarts from 'echarts/core';
import { LineChart } from 'echarts/charts';
import { GridComponent, TitleComponent, TooltipComponent } from 'echarts/components';
import { SVGRenderer } from 'echarts/renderers';

import chart_color_blue_300 from '@patternfly/react-tokens/dist/esm/chart_color_blue_300';
import chart_color_green_300 from '@patternfly/react-tokens/dist/esm/chart_color_green_300';
import chart_color_purple_300 from '@patternfly/react-tokens/dist/esm/chart_color_purple_300';
import chart_color_teal_300 from '@patternfly/react-tokens/dist/esm/chart_color_teal_300';
import chart_color_yellow_300 from '@patternfly/react-tokens/dist/esm/chart_color_yellow_300';
import chart_color_blue_300 from '@rh-felt/react-tokens/dist/esm/chart_color_blue_300';
import chart_color_green_300 from '@rh-felt/react-tokens/dist/esm/chart_color_green_300';
import chart_color_purple_300 from '@rh-felt/react-tokens/dist/esm/chart_color_purple_300';
import chart_color_teal_300 from '@rh-felt/react-tokens/dist/esm/chart_color_teal_300';
import chart_color_yellow_300 from '@rh-felt/react-tokens/dist/esm/chart_color_yellow_300';

// Register required components
echarts.use([GridComponent, LineChart, SVGRenderer, TitleComponent, TooltipComponent]);
Expand Down
Loading
Loading