@thecb/components 5.0.0-beta.15 → 5.0.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.eslintrc.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "extends": ["plugin:prettier/recommended", "plugin:react/recommended"],
3
+ "plugins": ["babel", "prettier"],
4
+ "settings": {
5
+ "react": {
6
+ "version": "detect"
7
+ }
8
+ },
9
+ "parser": "babel-eslint",
10
+ "rules": {
11
+ "react/jsx-filename-extension": 0,
12
+ "react/prop-types": 0,
13
+ "react/display-name": 0,
14
+ "prettier/prettier": "error",
15
+ "no-unused-vars": 2,
16
+ "babel/camelcase": 0,
17
+ "camelcase": ["off"]
18
+ },
19
+ "env": {
20
+ "browser": true
21
+ },
22
+ "parserOptions": {
23
+ "ecmaVersion": 11,
24
+ "sourceType": "module",
25
+ "ecmaFeatures": {
26
+ "jsx": true
27
+ }
28
+ }
29
+ }
@@ -0,0 +1,18 @@
1
+ ## Description
2
+ A brief description of the changes and purpose of the PR.
3
+
4
+ ## List of changes to be aware of:
5
+ - [x] ....
6
+ - [x] ....
7
+
8
+ ## Dev Tasks
9
+ - [ ] specs
10
+ - [ ] storys
11
+ - [ ] lint
12
+ - [ ] export component in ~/src/index.js
13
+
14
+ ## JIRA Task
15
+ [ABCD-123](https://citybase.atlassian.net/browse/ABCD-123)
16
+
17
+ ## Screenshots
18
+ (optional)
@@ -0,0 +1,17 @@
1
+ # Number of days of inactivity before an issue becomes stale
2
+ daysUntilStale: 30
3
+ # Number of days of inactivity before a stale issue is closed
4
+ daysUntilClose: 7
5
+ # Issues with these labels will never be considered stale
6
+ exemptLabels:
7
+ - "Don't close"
8
+ # Label to use when marking an issue as stale
9
+ staleLabel: stale
10
+ # Comment to post when marking an issue as stale. Set to `false` to disable
11
+ markComment: >
12
+ This issue has been automatically marked as stale because it has not had
13
+ recent activity. It will be closed within seven days if no further activity
14
+ occurs. If it needs to remain open, add the "Don't close" label.
15
+ # Comment to post when closing a stale issue. Set to `false` to disable
16
+ closeComment: >
17
+ This issue has been automatically closed because it was stale.
@@ -0,0 +1,30 @@
1
+ name: Bump Package Version
2
+ on:
3
+ push:
4
+ branches:
5
+ - "master"
6
+
7
+ jobs:
8
+ bump-version:
9
+ name: Bump version on master
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - name: Checkout source code
14
+ uses: actions/checkout@v2
15
+ with:
16
+ ref: ${{ github.ref }}
17
+ - name: "cat package.json"
18
+ run: cat ./package.json
19
+ - name: Setup Node.js
20
+ uses: actions/setup-node@v1
21
+ with:
22
+ node-version: 12
23
+ - name: Automated version bump
24
+ uses: phips28/gh-action-bump-version@master
25
+ with:
26
+ tag-prefix: ''
27
+ env:
28
+ GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
29
+ - name: "cat package.json"
30
+ run: cat ./package.json
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # The output is a Markdown table with columns for the PR (with a link),
4
+ # a branch, and JIRA ticket with link (if available).
5
+ #
6
+ # If the branch name starts with an id for a JIRA ticket (e.g.,
7
+ # PLAT-123), then a link to the ticket is created. Otherwise this
8
+ # column is blank.
9
+ #
10
+ # A link to the branch isn't valuable because they are usually
11
+ # deleted after merging.
12
+
13
+ from_tag=${FROM_TAG}
14
+ to_tag=${TAG##*/}
15
+
16
+ echo "## Changes"
17
+ echo ""
18
+ echo "### PRs"
19
+ # all merge commits, only merge commits
20
+ git --no-pager log --merges --format='%s' ${from_tag}..${to_tag} | \
21
+ # only pull-request merges
22
+ grep "Merge pull request" | \
23
+ gawk 'BEGIN { print "| PR | Branch | Ticket |" ;
24
+ print "| -- | ------ | ------ |" }
25
+ {if (match($0,/(#[0-9]+).*CityBaseInc\/(([A-Z]+-[0-9]+)\S+)/,m))
26
+ printf "| %s | %s | [%s](https://citybase.atlassian.net/browse/%s) |\n", m[1], m[2], m[3], m[3] }
27
+ {if (match($0,/(#[0-9]+).*CityBaseInc\/([a-z]\S+)/,m))
28
+ print "|", m[1], "|", m[2], "|", "|"}'
29
+
30
+ echo ""
31
+ echo "### Code Diff"
32
+ echo "https://github.com/${REPO}/compare/${from_tag}..${to_tag}"
33
+ echo ""
34
+
35
+ git show ${to_tag} --format=short | grep Tagger
@@ -0,0 +1,52 @@
1
+ on:
2
+ push:
3
+ tags:
4
+ - '*'
5
+
6
+
7
+ name: Create Release
8
+
9
+ jobs:
10
+ build:
11
+ name: Create Release
12
+ runs-on: ubuntu-latest
13
+ env:
14
+ REPO: ${{ github.repository }}
15
+ TAG: ${{ github.ref }}
16
+ steps:
17
+ - uses: actions/checkout@v2
18
+ - name: Get latest release
19
+ id: get_latest
20
+ run: |
21
+ tag_name=$(curl --silent --request GET \
22
+ --url https://api.github.com/repos/${{ github.repository }}/releases/latest \
23
+ --header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
24
+ --header "content-type: applicatoin/json" | jq -r .tag_name)
25
+ echo "::set-output name=tag_name::$tag_name"
26
+ - name: Fetch branches
27
+ run: git fetch --all --prune --unshallow
28
+ - name: Fetch tags
29
+ run: git fetch --unshallow origin +refs/tags/*:refs/tags/*
30
+ - name: Checkout master
31
+ run: git checkout master
32
+ - name: Build body
33
+ id: build_body
34
+ env:
35
+ FROM_TAG: ${{ steps.get_latest.outpus.tag_name}}
36
+ run: |
37
+ body=$(sh ./.github/workflows/create-release/build-body.sh)
38
+ body="${body//'%'/'%25'}"
39
+ body="${body//$'\n'/'%0A'}"
40
+ body="${body//$'\r'/'%0D'}"
41
+ echo "::set-output name=body::$body"
42
+ - name: Create Release
43
+ id: create_release
44
+ uses: actions/create-release@4d1b6075ce7561b672b8552148edec2f27584fe9
45
+ env:
46
+ GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
47
+ with:
48
+ tag_name: ${{ github.ref }}
49
+ release_name: Release ${{ github.ref }}
50
+ body: ${{ steps.build_body.outputs.body }}
51
+ draft: false
52
+ prerelease: false
@@ -0,0 +1,73 @@
1
+ name: Publish and Update
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ build:
9
+ name: Build
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - name: Checkout repository
14
+ uses: actions/checkout@v2
15
+ with:
16
+ ref: master
17
+
18
+ - name: Set up Node.js
19
+ uses: actions/setup-node@v1.2.0
20
+ with:
21
+ node-version: "10.x"
22
+
23
+ - name: Install dependencies
24
+ run: yarn install --silent
25
+
26
+ - name: Compile build
27
+ run: yarn build --silent
28
+
29
+ - name: Commit changes
30
+ uses: EndBug/add-and-commit@v2.1.0
31
+ with:
32
+ author_name: CB Feeps
33
+ author_email: feeps@thecitybase.com
34
+ message: "[auto] Update dist"
35
+ path: dist
36
+ pattern: "*.*"
37
+ force: true
38
+ ref: deploy
39
+ env:
40
+ GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
41
+
42
+ publish:
43
+ name: Publish to NPM Registry
44
+ runs-on: ubuntu-latest
45
+ needs: build
46
+
47
+ steps:
48
+ - name: Checkout repository
49
+ uses: actions/checkout@v2
50
+ with:
51
+ ref: deploy
52
+
53
+ - name: Set up Node.js for NPM
54
+ if: steps.check.outputs.changed == 'true'
55
+ uses: actions/setup-node@v1.2.0
56
+ with:
57
+ node-version: "10.x"
58
+ registry-url: "https://registry.npmjs.org"
59
+ scope: "@thecb"
60
+
61
+ - name: Install dependencies
62
+ if: steps.check.outputs.changed == 'true'
63
+ run: yarn install
64
+
65
+ - name: Create build
66
+ if: steps.check.outputs.changed == 'true'
67
+ run: yarn build
68
+
69
+ - name: Publish package to NPM
70
+ if: steps.check.outputs.changed == 'true'
71
+ run: yarn publish
72
+ env:
73
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -0,0 +1,3 @@
1
+ node_modules/
2
+ dist/
3
+ .storybook/
@@ -0,0 +1,4 @@
1
+ module.exports = {
2
+ stories: ['../src/**/*.stories.[tj]s'],
3
+ addons: ['@storybook/addon-knobs/register', '@storybook/addon-a11y']
4
+ };
@@ -0,0 +1,64 @@
1
+ import React from "react"
2
+ import { ThemeProvider } from "styled-components"
3
+ import { withKnobs, select, radios, text } from "@storybook/addon-knobs";
4
+ import { withA11y } from "@storybook/addon-a11y";
5
+ import { Provider } from 'react-redux';
6
+ import { createStore } from "redux";
7
+ import { Router } from "react-router-dom";
8
+ import { createBrowserHistory } from "history";
9
+
10
+ import ResizingContainer from "../src/components/atoms/layouts/examples/ResizingContainer";
11
+ import { SFTheme, APCTheme } from "./themes";
12
+
13
+ const themesLabel = "Theme";
14
+ const themes = {
15
+ SF: SFTheme,
16
+ APC: APCTheme,
17
+ None: {},
18
+ };
19
+ const defaultValue = SFTheme;
20
+ const groupId = "Theme";
21
+
22
+ const animateLabel = "Animate";
23
+ const animateOptions = {
24
+ play: "play",
25
+ pause: "pause"
26
+ };
27
+ const animateDefaultValue = "pause";
28
+ const animateGroupID = "Container";
29
+
30
+ const themeDecorator = storyFn => (
31
+ <ThemeProvider theme={select(themesLabel, themes, defaultValue, groupId)}>{storyFn()}</ThemeProvider>
32
+ )
33
+
34
+ export default ({ title, Component, height, reducer = () => { }, containerMax = "40rem", containerMin = "20rem" }) => {
35
+ const history = createBrowserHistory();
36
+ const store =createStore(
37
+ reducer,
38
+ window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
39
+ )
40
+ return {
41
+ title,
42
+ component: Component,
43
+ decorators: [
44
+ themeDecorator,
45
+ withKnobs,
46
+ withA11y,
47
+ storyFn => (
48
+ <Router history={history} >
49
+ <Provider store={store}>
50
+ <div style={{ height: "max-content", display: "flex", justifyContent: "center", flexDirection: "column" }}>
51
+ <ResizingContainer
52
+ height={height}
53
+ animate={radios(animateLabel, animateOptions, animateDefaultValue, animateGroupID)}
54
+ containerMax={text("Container Max", containerMax, animateGroupID)}
55
+ containerMin={text("Container Min", containerMin, animateGroupID)}>
56
+ {storyFn()}
57
+ </ResizingContainer >
58
+ </div>
59
+ </Provider>
60
+ </Router>
61
+ )
62
+ ]
63
+ }
64
+ };
@@ -0,0 +1 @@
1
+ export const APCTheme = {values: {"Button":{"active":{"primary":"background-color: #C8171E; border: 2px solid #C8171E; box-shadow: 0 0 10px #E30100;","secondary":"background-color: #F58D91; color: #FF0000; box-shadow: 0 0 10px #FF0000","smallPrimary":"background-color: #C8171E; border: 2px solid #C8171E; box-shadow: 0 0 10px #E30100","smallSecondary":"background-color: #F58D91; color: #FF0000; box-shadow: 0 0 10px #FF0000"},"backgroundColor":{"primary":"#EC1C24","secondary":"#F6F6F9","smallPrimary":"#EC1C24","smallSecondary":"#F6F6F9"},"border":{"primary":"2px solid #EC1C24;","secondary":"2px solid #EC1C24;","smallPrimary":"2px solid %#EC1C24;","smallSecondary":"2px solid #EC1C24;"},"color":{"primary":"#F6F6F9","secondary":"#EC1C24","smallPrimary":"#F6F6F9","smallSecondary":"#EC1C24"},"focus":{"primary":"outline: none; background-color: #C8171E; border: 2px solid #C8171E; box-shadow: 0 0 10px #E30100","secondary":"outline: none; background-color: #F58D91; color: #FF0000; box-shadow: 0 0 10px #FF0000;","smallPrimary":"outline: none; background-color: #C8171E; border: 2px solid #C8171E; box-shadow: 0 0 10px #E30100","smallSecondary":"outline: none; background-color: #F58D91; color: #FF0000; box-shadow: 0 0 10px #FF0000;"},"hover":{"primary":"cursor: pointer; background-color: #E30100; border: 2px solid #E30100; box-shadow: 0 0 10px #E30100;","secondary":"cursor: pointer; background-color: #FBD9D9; box-shadow: 0 0 10px #EC1C24; color: #EC1C24;","smallPrimary":"cursor: pointer; background-color: #E30100; border: 2px solid #E30100; box-shadow: 0 0 10px #E30100;","smallSecondary":"cursor: pointer; background-color: #FBD9D9; box-shadow: 0 0 10px #EC1C24; color: #EC1C24;"}},"Footer":{"backgroundColor":"#56575B"},"Header":{"backgroundColor":"#FFFFFF"},"HighlightTabRow":{"backgroundColor":"#215B9E"},"linkColor":"#15749D","logo":"logo.png","primaryColor":"#3B414D","secondaryColor":"#E5E7EC","textColor":"#000000"}}
@@ -0,0 +1,2 @@
1
+ export { SFTheme } from "./sf.theme"
2
+ export { APCTheme } from "./apc.theme"
@@ -0,0 +1 @@
1
+ export const SFTheme = {values: {"AmountCallout":{"color":"#347BB2"},"Breadcrumb":{"color":"#347BB2"},"Button":{"active":{"danger":"background-color: #870000; border: 2px solid #870000; box-shadow: 0 0 10px #ED125F;","ghost":"background-color: $(transparent)s; color: #001952; box-shadow: none;","primary":"background-color: #001952; border: 2px solid #001952; box-shadow: 0 0 10px #347BB2","secondary":"background-color: #D8E5F2; box-shadow: 0 0 10px #D8E5F2;","smallGhost":"background-color: $(transparent)s; color: #001952; box-shadow: none;","smallPrimary":"background-color: #001952; border: 2px solid #001952; box-shadow: 0 0 10px #347BB2;","smallSecondary":"background-color: #D8E5F2; box-shadow: 0 0 10px #D8E5F2;"},"backgroundColor":{"danger":"#ED125F","ghost":"transparent","primary":"#347BB2","secondary":"transparent","smallGhost":"transparent","smallPrimary":"#347BB2","smallSecondary":"transparent"},"border":{"danger":"2px solid #ED125F;","ghost":"none","primary":"2px solid #347BB2;","secondary":"2px solid #347BB2;","smallGhost":"none","smallPrimary":"2px solid #347BB2;","smallSecondary":"2px solid #347BB2;"},"color":{"danger":"#FFFFFF","ghost":"#347BB2","primary":"#FFFFFF","secondary":"#347BB2","smallGhost":"#347BB2","smallPrimary":"#FFFFFF","smallSecondary":"#347BB2"},"disabled":{"danger":"background-color: #6E727E; border: 2px solid #6E727E; &:focus { box-shadow: 0 0 10px #6E727E; }","ghost":"color: #6E727E; border: none","primary":"background-color: #6E727E; border: 2px solid #6E727E; &:focus { box-shadow: 0 0 10px #6E727E; }","secondary":"background-color: #6E727E; border: 2px solid #6E727E; &:focus { box-shadow: 0 0 10px #6E727E; }","smallGhost":"color: #6E727E; border: none;","smallPrimary":"background-color: #6E727E; border: 2px solid #6E727E; &:focus { box-shadow: 0 0 10px #6E727E; }","smallSecondary":"background-color: #6E727E; border: 2px solid #6E727E; &:focus { box-shadow: 0 0 10px #6E727E; }"},"focus":{"danger":"outline: none; background-color: #BA002C; border: 2px solid #BA002C; box-shadow: 0 0 10px #ED125F","ghost":"outline: none; box-shadow: none; color: #024C85;","primary":"outline: none; background-color: #024C85; border: 2px solid #024C85; box-shadow: 0 0 10px #347BB2","secondary":"outline: none; background-color: #EAF2F8; box-shadow: 0 0 10px #EAF2F8;","smallGhost":"outline: none; box-shadow: none; color: #024C85;","smallPrimary":"outline: none; background-color: #024C85; border: 2px solid #024C85; box-shadow: 0 0 10px #347BB2","smallSecondary":"outline: none; background-color: #EAF2F8; box-shadow: 0 0 10px #EAF2F8;"},"hover":{"danger":"background-color: #BA002C; border: 2px solid #BA002C; box-shadow: 0 0 10px #ED125F;","ghost":"cursor: pointer; color: #024C85;","primary":"cursor: pointer; background-color: #024C85; border: 2px solid #024C85; box-shadow: 0 0 10px #347BB2","secondary":"cursor: pointer; background-color: #EAF2F8; box-shadow: 0 0 10px #EAF2F8;","smallGhost":"cursor: pointer; color: #024C85;","smallPrimary":"cursor: pointer; background-color: #024C85; border: 2px solid #024C85; box-shadow: 0 0 10px #347BB2","smallSecondary":"cursor: pointer; background-color: #EAF2F8; box-shadow: 0 0 10px #EAF2F8;"}},"Checkbox":{"boxShadow":{"default":"0 0 0 3px #D8E5F2;"},"checkedStyles":{"default":"background: #347BB2; border: 1px solid #347BB2;"}},"Dropdown":{"hoverColor":"#EFFAFF","selectedColor":"#347BB2"},"Footer":{"backgroundColor":"#182848","logoHeight":"52px","subfooterColor":"#347BB2"},"FormInput":{"hoverFocusStyles":{"default":"outline: none; text-decoration: underline; color: #024C85;"},"linkColor":{"default":"#347BB2"}},"Global":{"baseFontSize":"16px","baseMobileFontSize":"14px","pageBackground":"#F6F6F9"},"Header":{"backgroundColor":"#347BB2"},"Icons":{"accentColor":{"error":"#3B414D","info":"#3B414D","success":"#3B414D"},"primaryColor":{"error":"#FFFFFF","info":"#FFFFFF","success":"#FFFFFF"},"singleIconColor":{"darkMode":"#FFFFFF","primary":"#347BB2","secondary":"#3B414D"},"subIconColor":{"error":"#ED125F","info":"#347BB2","success":"#317D4F"}},"ModalLink":{"linkColor":"#347BB2"},"NavMenu":{"backgroundColor":"#347BB2"},"ProfileTab":{"activeTabAccent":"#347BB2","activeTabBackground":"#FFFFFF","activeTabHover":"#D8E5F2"},"RadioButton":{"activeColor":"#347BB2"},"Spinner":{"color":"#347BB2"},"ToggleSwitch":{"onBackground":"#347BB2"},"Workflow":{"accentColor":"#214566","fontFamily":"Open Sans, sans-serif","linkColor":"#214566","primaryButtonColor":"#347BB2","secondaryButtonColor":"#347BB2","textColor":"#091325","workflowFooterColor":"#182848","workflowHeaderColor":"#347BB2"},"linkColor":"#15749D","logo":"logo.png","primaryColor":"#3B414D","secondaryColor":"#E5E7EC","textColor":"#000000"}}
package/.tool-versions ADDED
@@ -0,0 +1 @@
1
+ nodejs 15.8.0