-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into confirmation-improvements
- Loading branch information
Showing
191 changed files
with
69,480 additions
and
2,109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: CI | ||
on: | ||
push: | ||
paths: ['cl2-component-library/src/**']# Trigger the action only when files change in the folders defined here | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Begin CI... | ||
uses: actions/checkout@v3 | ||
|
||
- name: Use Node 16 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.15.0 | ||
|
||
- name: Use cached node_modules | ||
uses: actions/cache@v3 | ||
with: | ||
path: cl2-component-library/node_modules | ||
key: nodeModules-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
nodeModules- | ||
- name: Install dependencies | ||
run: cd cl2-component-library && npm ci | ||
env: | ||
CI: true | ||
|
||
- name: Lint | ||
run: cd cl2-component-library && npm run lint | ||
env: | ||
CI: true | ||
|
||
- name: Test | ||
run: cd cl2-component-library && npm run test --ci --coverage --maxWorkers=2 | ||
env: | ||
CI: true | ||
|
||
- name: Build | ||
run: cd cl2-component-library && npm run build | ||
env: | ||
CI: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Build and Deploy Storybook | ||
on: | ||
push: | ||
branches: | ||
- master | ||
paths: ['cl2-component-library/src/**'] # Trigger the action only when files change in the folders defined here | ||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v3 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Use Node 16 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.15.0 | ||
|
||
- name: Install and Build 🔧 | ||
run: | # Install npm packages and build the Storybook files | ||
cd cl2-component-library | ||
npm ci | ||
npm run build-storybook | ||
- name: Deploy 🚀 | ||
uses: JamesIves/[email protected] | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GB_TOKEN }} | ||
# Test branch | ||
BRANCH: cl2-component-library-storybook # The branch the action should deploy to. | ||
FOLDER: cl2-component-library/docs-build # The folder that the build-storybook script generates files. | ||
CLEAN: true # Automatically remove deleted files from the deploy branch | ||
TARGET_FOLDER: docs # The folder that we serve our Storybook files from |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"sourceType": "unambiguous", | ||
"presets": [ | ||
[ | ||
"@babel/preset-env", | ||
{ | ||
"targets": { | ||
"chrome": 100 | ||
} | ||
} | ||
], | ||
"@babel/preset-typescript", | ||
"@babel/preset-react" | ||
], | ||
"plugins": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
module.exports = { | ||
extends: ['eslint:recommended', 'plugin:react/recommended', 'plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended', 'plugin:jsx-a11y/recommended', 'plugin:react-hooks/recommended', 'plugin:storybook/recommended'], | ||
settings: { | ||
react: { | ||
version: 'detect' | ||
} | ||
}, | ||
env: { | ||
jest: true | ||
}, | ||
rules: { | ||
'@typescript-eslint/explicit-module-boundary-types': 'off', | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'react/prop-types': 'off', | ||
'react/display-name': 'off', | ||
'@typescript-eslint/no-empty-function': 'off', | ||
'@typescript-eslint/no-unused-vars': ['warn', { | ||
argsIgnorePattern: '^_', | ||
varsIgnorePattern: '^_' | ||
}], | ||
'no-console': ['warn', { | ||
allow: ['warn', 'error'] | ||
}] | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
*.log | ||
.DS_Store | ||
node_modules | ||
.cache | ||
dist | ||
junit.xml | ||
coverage | ||
docs-build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"printWidth": 80, | ||
"semi": true, | ||
"singleQuote": true, | ||
"trailingComma": "es5", | ||
"endOfLine": "auto", | ||
"arrowParens": "always" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { create } from '@storybook/theming'; | ||
|
||
export default create({ | ||
colorPrimary: '#001758o', | ||
colorSecondary: '#FF672F', | ||
base: 'light', | ||
brandTitle: 'CitizenLab', | ||
brandImage: | ||
'./logo.png', | ||
brandTarget: '_self', | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
module.exports = { | ||
stories: ['../src/**/*.mdx', '../src/**/*.stories.tsx'], | ||
addons: [ | ||
'@storybook/addon-actions', | ||
'@storybook/addon-links', | ||
'@storybook/addon-docs', | ||
'@storybook/addon-knobs', | ||
], | ||
staticDirs: ['../public'], | ||
typescript: { | ||
check: false, | ||
checkOptions: {}, | ||
reactDocgen: 'react-docgen-typescript', | ||
reactDocgenTypescriptOptions: { | ||
shouldExtractLiteralValuesFromEnum: true, | ||
propFilter: (prop) => | ||
prop.parent ? !/node_modules/.test(prop.parent.fileName) : true, | ||
}, | ||
}, | ||
framework: { | ||
name: '@storybook/react-webpack5', | ||
options: {}, | ||
}, | ||
docs: { | ||
autodocs: true, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// .storybook/manager.js | ||
|
||
import { addons } from '@storybook/addons'; | ||
|
||
import citizenlabTheme from './citizenlabTheme'; | ||
|
||
addons.setConfig({ | ||
theme: citizenlabTheme, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<script | ||
async | ||
defer | ||
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDRtFe1KRBnGfDy_ijw6yCYsYnEkQRl9Cw&libraries=places&callback=myCallbackFunc" | ||
></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import ThemeDecorator from './themedecorator'; | ||
|
||
export const decorators = [ThemeDecorator]; | ||
|
||
export const parameters = { | ||
options: { | ||
storySort: { | ||
method: 'alphabetical', | ||
order: ['Design', 'Components'], | ||
locales: '', | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from 'react'; | ||
import { ThemeProvider } from 'styled-components'; | ||
import { getTheme } from '../src/utils/styleUtils'; | ||
import GlobalStyle from '../src/global-styles'; | ||
import '../src/assets/css/reset.min.css'; | ||
import '../src/assets/fonts/fonts.css'; | ||
import 'tippy.js/dist/tippy.css'; | ||
import 'tippy.js/themes/light.css'; | ||
|
||
const ThemeDecorator = (storyFn) => ( | ||
<ThemeProvider theme={getTheme(null)}> | ||
<GlobalStyle /> | ||
{storyFn()} | ||
</ThemeProvider> | ||
); | ||
|
||
export default ThemeDecorator; |
Oops, something went wrong.