Skip to content

Commit

Permalink
Revert "Merge branch 'master' of https://github.com/cisco-sbg-ui/atom…
Browse files Browse the repository at this point in the history
…ic-react into 3pg/feature/button-card-component"

This reverts commit 7ad15fd, reversing
changes made to b53b1d4.
  • Loading branch information
andreearusu committed Oct 29, 2021
1 parent 7ad15fd commit 5b6d5e5
Show file tree
Hide file tree
Showing 441 changed files with 29,059 additions and 44,156 deletions.
Empty file added .buildme
Empty file.
4 changes: 1 addition & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:cypress/recommended",
"prettier"
"plugin:cypress/recommended"
],
"parserOptions": {
"sourceType": "module"
Expand All @@ -17,7 +16,6 @@
"module": true,
"require": true,
"Buffer": true,
"process": true,
"__dirname": true
},
"plugins": ["react-hooks"],
Expand Down
2 changes: 2 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

Expand Down
52 changes: 0 additions & 52 deletions .github/workflows/ci.yml

This file was deleted.

34 changes: 0 additions & 34 deletions .github/workflows/update-snapshots.yml

This file was deleted.

9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@
/.vercel/
/.nyc_output/
/coverage/
/cypress/snapshots/actual/
/cypress/snapshots/diff/
/lib/
/node_modules/
/public/

/A*.js
/babel-preset.js
/babel-preset-local.js
/helpers*.js
/hooks*.js
/style-inject*.js
/index*.js
/useA*.js
/_rollupPluginBabelHelpers*
6 changes: 6 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ build/
coverage/
cypress/
docs/
fonts/
lib-demo/
public/

.buildme
.editorconfig
.eslintrc.json
.gitignore
Expand All @@ -18,6 +21,9 @@ babel.config.js
babel-preset-local.js
gatsby-config.js
gatsby-node.js
rollup.config.js
webpack.lib-demo.config.js

**/__image_snapshots__/
*.spec.js
*.mdx
19 changes: 19 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
language: node_js
dist: xenial
os: linux
node_js:
- 12
cache:
npm: true
directories:
- "~/.npm"
- "~/.cache"
install:
- npm ci --ignore-scripts --prefer-offline
- npm run cypress:install
script:
- npm test
# - npm run updateSnapshots
after_success:
- npm run upload-coverage
# - sh build/.travis-push.sh
4 changes: 4 additions & 0 deletions .vercelignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
.nyc_output/
coverage/
cypress/
fonts/
lib-demo/
public/

.buildme
.travis.yml
codecov.yml
cypress.json
README.md
webpack.lib-demo.config.js
31 changes: 11 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,19 @@
# Atomic-React
# Atomic components for React

## Introduction
## Background

Atomic-React is a React library that implements UI components according to the [Atomic design specification](http://ux-document-lnx/~designer/sbg-ux/components/atoms/getting-started.html) (requires VPN). Developers can enjoy the following features:
The Cisco Security Business Group (SBG) has adopted [Atomic/Hammurabi](http://ux-document-lnx/~designer/sbg-ux/1.7.0/components/atoms/getting-started.html) as a design standard. The majority of the SBG front-ends are written using the React library and are configured based on their use case. For a variety of reasons, the existing UI toolkit is unable to support the various use cases necessary for adoption. In addition, a React-specific library offers greater usability and maintainablility over a styles-only solution.

- Flexible, tree-shakable components
- Full [documentation](https://atomic-react.security.cisco.com/)
- [Auto-import](https://atomic-react.security.cisco.com/#integrating)
- Baked-in accessibility
- Responsive helpers
- CSS helpers
- Form validation
- Extensibility
## Project Goal

## Questions
The aim is to provide an Atomic Design component library for React developers that enables them to import only the components that are necessary for their application/library. The library should be fully documented and reduce barriers to adoption as much as possible. In addition, the library should fully support the available design standards.

Consult [the documentation](https://atomic-react.security.cisco.com). For additional help and support, please reach out to Anton Frattaroli on Webex Teams, or file an issue in this repository.
## The Plan For Now

## Contributing
Using the Atomic UI Toolkit (v1.8.0) as a base, and leveraging the work done in [threatgrid/atomic-ui-components], create a base set of components while addressing common developer issues such as CSS specificity and library size (in KB). Get documentation set up, published. Get a package into artifactory. Aim for [WAI-ARIA](https://www.w3.org/WAI/standards-guidelines/aria/) compliance.

### Design Development
## Future Discussion Points

See the [Atomic contribution page](http://ux-document-lnx/~designer/sbg-ux/components/atoms/contribution.html).

### Component Development

Feel free to reach out to Anton Frattaroli via Webex Teams to discuss contributions.
- Public docs and package.
- Mobile friendliness.
- Refactor to align better with conceptual framework.
12 changes: 11 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const env = process.env.BABEL_ENV;

let config = {
presets: ["babel-preset-gatsby"],
plugins: []
plugins: ["@babel/plugin-proposal-class-properties"]
};

if (nodeEnv !== "production") {
Expand All @@ -15,9 +15,19 @@ if (nodeEnv !== "production") {
]);
}

if (["cra"].includes(env)) {
config = {
presets: ["@babel/preset-react", "@babel/preset-env"]
};
}

if (["lib"].includes(env)) {
config = {
presets: ["@babel/preset-react", ["@babel/preset-env", {modules: false}]],
plugins: [
"@babel/plugin-proposal-class-properties",
"./build/babel-transform-paths.js"
],
ignore: [/\.spec\.js$/]
};
}
Expand Down
34 changes: 34 additions & 0 deletions build/.travis-push.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/sh
# Credit: https://gist.github.com/willprice/e07efd73fb7f13f917ea

setup_git() {
git config --global user.email "travis@travis-ci.org"
git config --global user.name "Travis CI"
}

commit_snapshots() {
git checkout build/add-travis
git add -A
# Create a new commit with a custom build message
# with "[skip ci]" to avoid a build loop
# and Travis build number for reference
git commit -m "test: update snapshots" -m "[skip ci]"
}

push_files() {
# Add new "origin" with access token in the git URL for authentication
git remote set-url origin https://frattaro:${GH_TOKEN}@github.com/threatgrid/atomic-react > /dev/null 2>&1
git push origin build/add-travis --quiet
}

setup_git

commit_snapshots

# Attempt to commit to git only if "git commit" succeeded
if [ $? -eq 0 ]; then
echo "A new commit with changed snapshots exists. Uploading to GitHub"
push_files
else
echo "No changes to snapshots. Nothing to do"
fi
50 changes: 50 additions & 0 deletions build/babel-transform-paths.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
const {join, dirname, relative} = require("path");
const wrapListener = require("babel-plugin-detective/wrap-listener");

module.exports = wrapListener(listener, "transform-paths");

function listener(path, file) {
if (!path.isLiteral()) return;

if (
path.node.value === "./AAppContext" ||
path.node.value === "../AApp/AAppContext"
) {
path.node.value = "../../../AAppContext";
}

if (path.node.value === "./AAccordionContext") {
path.node.value = "./../../../AAccordionContext";
}

if (path.node.value === "./AAccordionPanelContext") {
path.node.value = "./../../../AAccordionPanelContext";
}

if (
path.node.value === "../AButtonGroup/AButtonGroupContext" ||
path.node.value === "./AButtonGroupContext"
) {
path.node.value = "./../../../AButtonGroupContext";
}

if (
path.node.value === "../AForm/AFormContext" ||
path.node.value === "./AFormContext"
) {
path.node.value = "./../../../AFormContext";
}

if (path.node.value === "./ATabContext") {
path.node.value = "./../../../ATabContext";
}

if (path.node.value === "./AThemeContext") {
path.node.value = "./../../../AThemeContext";
}

if (path.node.value.endsWith(".scss") || path.node.value.endsWith(".json")) {
const from = dirname(relative(file.opts.cwd, file.opts.filename));
path.node.value = "./" + join("../../../", from, path.node.value);
}
}
4 changes: 2 additions & 2 deletions build/generate-babel-preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ files.forEach((x) => {
if (data.includes("export {default} from")) {
declarations.push({
default: path[3],
path: `@cisco-sbg-ui/atomic-react/lib/components/${path[3]}`
path: `@cisco-ats/atomic-react/lib/components/${path[3]}`
});
localDeclarations.push({
default: path[3],
Expand All @@ -34,7 +34,7 @@ files.forEach((x) => {
declarations.push({
default: path[3] + "Exports",
members: getComponents(data),
path: `@cisco-sbg-ui/atomic-react/lib/components/${path[3]}`
path: `@cisco-ats/atomic-react/lib/components/${path[3]}`
});
localDeclarations.push({
default: path[3] + "Exports",
Expand Down
2 changes: 0 additions & 2 deletions cypress.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
"runMode": 2,
"openMode": 0
},
"screenshotsFolder": "./cypress/snapshots/actual",
"testFiles": "**/*.spec.js",
"trashAssetsBeforeRuns": true,
"video": false,
"viewportHeight": 720,
"viewportWidth": 1480
Expand Down
Loading

0 comments on commit 5b6d5e5

Please sign in to comment.