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

Add themepatternflyorg to build PF React components #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@ _site/*
.jekyll-cache
.sass-cache
Gemfile.lock
.vscode/*
vscode/*
src/generated/**
node_modules/*
public/*
.cache
9 changes: 9 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package.json
package-lock.json
_site
assets/css/just-the-docs-default.scss
assets/css/just-the-docs-light.scss
assets/css/just-the-docs-dark.scss
assets/js/vendor/lunr.min.js
assets/js/search-data.json
assets/js/just-the-docs.js
48 changes: 0 additions & 48 deletions Gemfile

This file was deleted.

53 changes: 0 additions & 53 deletions _config.yml

This file was deleted.

83 changes: 83 additions & 0 deletions commonComponents/delete-modal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
id: Delete modal
section: components
has_children: true
nav_order: 2
has_toc: true
---

import {useState} from 'react';
import { Button, Text, Modal } from '@patternfly/react-core';

### Delete modal

```js
modal = () => {

const modalVariant = ButtonVariant.danger;
const titleIconVariant = 'warning';
const showClose = true;
const buttonConfirmVariant = ButtonVariant.danger;
const buttonCancelVariant = ButtonVariant.link;
const confirmActionLabel = 'Delete';
const cancelActionLabel = 'Cancel';
const description = 'Kafka instance will be deleted';
const ariaLabel = 'Test';
const title = 'Delete instance?';

const [isModalOpen, setIsModalOpen] = useState(false);

const handleModalToggle = () => {
setIsModalOpen(!isModalOpen);
}

const isDisabledConfirmButton = () => {
// if (instanceStatus === InstanceStatus.READY) {
// if (instanceNameInput?.toLowerCase() === selectedInstanceName?.toLowerCase()) {
// return false;
// }
// return true;
// }
return false;
};

return (
<>
<Button onClick={handleModalToggle}>Show Delete Modal</Button>
<Modal
variant={ButtonVariant.danger}
isOpen={isModalOpen}
aria-label={ariaLabel}
title={title}
titleIconVariant={titleIconVariant}
showClose={showClose}
onClose={handleModalToggle}
// appendTo={getModalAppendTo}
actions={[
<Button
// id={id}
// key={key}
variant={buttonConfirmVariant}
onClick={() => onClickConfirmButton && onClickConfirmButton(selectedItemData)}
isDisabled={isDisabledConfirmButton}
>
{confirmActionLabel}
</Button>,
<Button
// id={cancelButtonId}
// key={cancelButtonKey}
variant={buttonCancelVariant}
onClick={handleModalToggle}
>
{cancelActionLabel}
</Button>,
]}
>
{description && (
<Text dangerouslySetInnerHTML={{ __html: description || '' }} />
)}
</Modal>
</>
)
}
```
4 changes: 4 additions & 0 deletions designs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ nav_order: 2
has_toc: true
---

import { Card } from '@patternfly/react-core';

# Designs

<Card></Card>

Select a category to view designs related to that topic.
28 changes: 28 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "just-the-docs",
"version": "0.3.3",
"description": "A modern Jekyll theme for documentation",
"repository": "pmarsceill/just-the-docs",
"license": "MIT",
"bugs": "https://github.com/pmarsceill/just-the-docs/issues",
"devDependencies": {
"theme-patternfly-org": "^0.4.59"
},
"resolutions": {
"sharp": "0.25.4"
},
"scripts": {
"test": "stylelint '**/*.scss'",
"format": "prettier --write '**/*.{scss,js,json}'",
"stylelint-check": "stylelint-config-prettier-check",
"start": "theme-patternfly-org start",
"build": "theme-patternfly-org build all"
},
"dependencies": {
"@patternfly/patternfly": "4.102.2",
"@patternfly/react-core": "^4.115.2",
"patternfly": "^3.59.5",
"react": "^17.0.2",
"react-dom": "^17.0.2"
}
}
14 changes: 14 additions & 0 deletions patternfly-docs.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// This module is shared between NodeJS and babelled ES5
module.exports = {
hasGdprBanner: false,
hasFooter: false,
hasVersionSwitcher: false,
sideNavItems: [
{ section: 'components' },
],
topNavItems: [
],
port: 4001,
pathPrefix: 'appservices-design'
};

8 changes: 8 additions & 0 deletions patternfly-docs.css.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Global theme CSS
import 'theme-patternfly-org/global.css';

// Patternfly
import '@patternfly/patternfly/patternfly.css';

// Utilities
import '@patternfly/patternfly/patternfly-addons.css';
15 changes: 15 additions & 0 deletions patternfly-docs.routes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

// This module is shared between NodeJS and babelled ES5
/* eslint-disable global-require */
const isClient = Boolean(process.env.NODE_ENV);
module.exports = {
'/': {
SyncComponent: isClient && require('./src/index').default
},
'/404': {
SyncComponent: isClient && require('theme-patternfly-org/pages/404').default,
title: '404 Error'
}
};

/* eslint-enable global-require */
6 changes: 6 additions & 0 deletions patternfly-docs.source.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const path = require('path');

module.exports = sourceMD => {
// Core MD
sourceMD('commonComponents/**/*.md', 'html');
};
10 changes: 10 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react';
import { PageSection } from '@patternfly/react-core';

const HomePage = () => (
<PageSection variant="light">
Just getting started? Take a look at the..
</PageSection>
);

export default HomePage;
Loading