Skip to content

Commit 9713c04

Browse files
Merge pull request #954 from GAUNSD/gmurcia/tearsheet
feat(Tearsheet): Implement new Tearsheet component
2 parents ea5f4bb + fc3e5e7 commit 9713c04

39 files changed

Lines changed: 2031 additions & 427 deletions

File tree

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Please reference [PatternFly's AI-assisted development guidelines](https://githu
2929
### Before adding a new component:
3030

3131
- make sure your use case is new/complex enough to be added to this extension
32-
- the component should bring a value value above and beyond existing PatternFly components
32+
- the component should bring a value above and beyond existing PatternFly components
3333

3434
### To add a new component:
3535

@@ -40,7 +40,7 @@ Please reference [PatternFly's AI-assisted development guidelines](https://githu
4040

4141
#### Example component:
4242

43-
```
43+
``` TSX
4444
import * as React from 'react';
4545
import { Content } from '@patternfly/react-core';
4646
import { createUseStyles } from 'react-jss';
@@ -75,7 +75,7 @@ export default MyComponent;
7575

7676
#### Index file example:
7777

78-
```
78+
``` TSX
7979
export { default } from './MyComponent';
8080
export * from './MyComponent';
8181
```
@@ -99,8 +99,7 @@ src
9999

100100
#### Component API definition example:
101101

102-
```
103-
102+
``` TSX
104103
import { FunctionComponent } from 'react';
105104

106105
// when possible, extend available PatternFly types
@@ -113,7 +112,7 @@ export const MyComponent: FunctionComponent<MyComponentProps> = ({ customLabel,
113112

114113
#### Markdown file example:
115114

116-
````
115+
```` MDX
117116
---
118117
section: Component groups
119118
subsection: My component's category
@@ -135,7 +134,7 @@ MyComponent has been created to demo contributing to this repository.
135134

136135
#### Component usage file example: (`MyComponentExample.tsx`)
137136

138-
```
137+
``` TSX
139138
import { FunctionComponent } from 'react';
140139

141140
const MyComponentExample: FunctionComponent = () => (

package-lock.json

Lines changed: 56 additions & 53 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
"whatwg-fetch": "^3.6.20"
8686
},
8787
"dependencies": {
88-
"@patternfly/react-drag-drop": "^6.0.0",
88+
"@patternfly/react-drag-drop": "^6.6.2",
8989
"@patternfly/react-tokens": "^6.0.0",
9090
"sharp": "^0.34.0"
9191
}

packages/module/generate-fed-package-json.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
const fse = require('fs-extra');
2-
const { globSync } = require('glob');
32
const path = require('path');
43
const { default: getDynamicModuleMap } = require('../../scripts/parse-dynamic-modules.mjs');
4+
const { toPosixPath, posixGlobSync, posixRelative } = require('./utils');
55

6-
const root = process.cwd();
6+
const root = toPosixPath(process.cwd());
77

8-
const sourceFiles = globSync(`${root}/src/*/`)
8+
const sourceFiles = posixGlobSync(`${root}/src/*/`)
99
.map((name) => name.replace(/\/$/, ''));
10-
11-
const indexTypings = globSync(`${root}/src/index.d.ts`);
10+
11+
const indexTypings = posixGlobSync(`${root}/src/index.d.ts`);
1212

1313
const ENV_AGNOSTIC_ROOT = `${root}/dist/dynamic`
1414

@@ -23,9 +23,9 @@ async function copyTypings(files, dest) {
2323

2424
async function createPackage(file) {
2525
const fileName = file.split('/').pop();
26-
const esmSource = globSync(`${root}/dist/esm/${fileName}/**/index.js`)[0];
27-
const cjsSource = globSync(`${root}/dist/cjs/${fileName}/**/index.js`)[0];
28-
const typingsSource = globSync(`${root}/dist/esm/${fileName}/**/index.d.ts`)[0]
26+
const esmSource = posixGlobSync(`${root}/dist/esm/${fileName}/**/index.js`)[0];
27+
const cjsSource = posixGlobSync(`${root}/dist/cjs/${fileName}/**/index.js`)[0];
28+
const typingsSource = posixGlobSync(`${root}/dist/esm/${fileName}/**/index.d.ts`)[0]
2929
/**
3030
* Prevent creating package.json for directories with no JS files (like CSS directories)
3131
*/
@@ -39,14 +39,14 @@ async function createPackage(file) {
3939
// ensure the directory exists
4040
fse.ensureDirSync(destDir)
4141

42-
const esmRelative = path.relative(file, esmSource).replace('/dist', '');
43-
const cjsRelative = path.relative(file, cjsSource).replace('/dist', '');
44-
const tsRelative = path.relative(file, typingsSource).replace('/dist', '')
42+
const esmRelative = posixRelative(file, esmSource).replace('/dist', '');
43+
const cjsRelative = posixRelative(file, cjsSource).replace('/dist', '');
44+
const tsRelative = posixRelative(file, typingsSource).replace('/dist', '')
4545
const content = {
4646
main: cjsRelative,
4747
module: esmRelative,
4848
};
49-
const typings = globSync(`${root}/src/${fileName}/*.d.ts`);
49+
const typings = posixGlobSync(`${root}/src/${fileName}/*.d.ts`);
5050
const cmds = [];
5151
content.typings = tsRelative;
5252
cmds.push(copyTypings(typings, `${root}/dist/${fileName}`));

packages/module/generate-index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
const fse = require('fs-extra');
2-
const { globSync } = require('glob');
32
const path = require('path');
3+
const { posixGlobSync } = require('./utils');
44

55
const root = process.cwd();
66

77
const ENV_AGNOSTIC_ROOT = `${root}/src`
88

9-
const sourceFiles = globSync(path.resolve(__dirname, './src/*/index.ts'))
9+
const sourceFiles = posixGlobSync(path.resolve(__dirname, './src/*/index.ts'))
1010

1111
async function generateIndex(files) {
1212
// ensure the dynamic root exists

packages/module/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,22 @@
3131
"tag": "alpha"
3232
},
3333
"dependencies": {
34-
"@patternfly/react-core": "^6.0.0",
34+
"@patternfly/react-core": "^6.6.2",
3535
"@patternfly/react-icons": "^6.0.0",
3636
"@patternfly/react-styles": "^6.0.0",
37-
"@patternfly/react-table": "^6.0.0",
37+
"@patternfly/react-table": "^6.6.2",
3838
"react-jss": "^10.10.0"
3939
},
4040
"peerDependencies": {
41-
"@patternfly/react-drag-drop": "^6.0.0",
41+
"@patternfly/react-drag-drop": "^6.6.2",
4242
"react": "^17 || ^18 || ^19",
4343
"react-dom": "^17 || ^18 || ^19"
4444
},
4545
"devDependencies": {
46-
"@patternfly/patternfly-a11y": "^5.1.0",
4746
"@patternfly/documentation-framework": "^6.5.16",
48-
"@patternfly/react-code-editor": "^6.0.0",
4947
"@patternfly/patternfly": "^6.0.0",
48+
"@patternfly/patternfly-a11y": "^5.1.0",
49+
"@patternfly/react-code-editor": "^6.6.2",
5050
"@types/react": "^18.2.33",
5151
"@types/react-dom": "^18.3.1",
5252
"react": "^18.3.1",

0 commit comments

Comments
 (0)