Skip to content

Commit 5c7371d

Browse files
rsarisDave Ferris
authored andcommitted
UIDS-27 Add CopyToClipboard Popper and TrackedButton components
2 parents 8c235f6 + 2253e5a commit 5c7371d

32 files changed

+2571
-3260
lines changed

.eslintrc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"browser": true
1818
},
1919
"parser": "babel-eslint",
20-
"plugins": [ "babel", "react" ],
20+
"plugins": [ "babel", "react", "react-hooks" ],
2121
"rules": {
2222
"babel/semi": 2,
2323
"import/prefer-default-export": 0,
@@ -33,9 +33,7 @@
3333
"no-alert": 0,
3434
"react/destructuring-assignment": 0,
3535
"react/forbid-prop-types": 0,
36-
"react/jsx-props-no-spreading": [2, {
37-
"html": "ignore"
38-
}],
36+
"react/jsx-props-no-spreading": 0,
3937
"react/jsx-no-target-blank": 1,
4038
"react/jsx-no-undef": 0,
4139
"react/jsx-one-expression-per-line": 0,
@@ -102,6 +100,8 @@
102100
"requiredFirst": false,
103101
"sortShapeProp": true
104102
}],
103+
"react-hooks/exhaustive-deps": "warn",
104+
"react-hooks/rules-of-hooks": "error",
105105
"semi": 0
106106
},
107107
}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ lib
2121
.env.test.local
2222
.env.production.local
2323

24+
# Ignore Jetbrains IDE settings
25+
/.idea
26+
2427
npm-debug.log*
2528
yarn-debug.log*
2629
yarn-error.log*

package.json

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,21 @@
22
"name": "ui-design-system",
33
"version": "1.0.3",
44
"dependencies": {
5+
"@fortawesome/fontawesome-svg-core": "^1.2.27",
6+
"@fortawesome/free-regular-svg-icons": "^5.12.1",
7+
"@fortawesome/free-solid-svg-icons": "^5.12.1",
8+
"@fortawesome/react-fontawesome": "^0.1.9",
59
"bootstrap": "^4.3.1",
610
"classnames": "^2.2.6",
711
"node-sass": "^4.13.1",
812
"polished": "^3.4.2",
913
"prop-types": "^15.7.2",
10-
"react": "^16.12.0",
1114
"react-bootstrap": "^1.0.0-beta.16",
12-
"react-dom": "^16.12.0"
15+
"react-transition-group": "^4.3.0",
16+
"react-copy-to-clipboard": "^5.0.2",
17+
"react-popper": "^1.3.7",
18+
"react-tracking": "^7.3.0",
19+
"uuid": "^7.0.2"
1320
},
1421
"scripts": {
1522
"build": "NODE_ENV=production babel src --out-dir lib --copy-files",
@@ -35,6 +42,10 @@
3542
"last 1 safari version"
3643
]
3744
},
45+
"peerDependencies": {
46+
"react": "^16.12.0",
47+
"react-dom": "^16.12.0"
48+
},
3849
"devDependencies": {
3950
"@babel/cli": "^7.8.4",
4051
"@babel/core": "^7.8.4",
@@ -51,6 +62,7 @@
5162
"@storybook/addons": "^5.3.13",
5263
"@storybook/react": "^5.3.13",
5364
"@storybook/storybook-deployer": "^2.8.1",
65+
"@testing-library/react-hooks": "^3.2.1",
5466
"babel-eslint": "^10.0.3",
5567
"babel-loader": "^8.0.6",
5668
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
@@ -63,7 +75,10 @@
6375
"eslint-plugin-import": "^2.20.1",
6476
"eslint-plugin-jsx-a11y": "^6.2.3",
6577
"eslint-plugin-react": "^7.18.3",
78+
"eslint-plugin-react-hooks": "^2.5.1",
6679
"eslint-utils": "^1.4.3",
80+
"react": "^16.12.0",
81+
"react-dom": "^16.12.0",
6782
"react-test-renderer": "^16.12.0",
6883
"sass-loader": "^8.0.2",
6984
"style-loader": "^1.1.3"

scss/borders.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
$ux-border-radius: 0.25rem;

scss/box_shadow.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
$ux-navbar-shadow-color: rgba( 0, 0, 0, 0.26 );
2+
3+
$ux-box-shadow: 0 2px 5px $ux-navbar-shadow-color;
4+
$ux-box-shadow-light: 0 1px 1px $ux-navbar-shadow-color;
5+
6+
$ux-box-shadow-card: 0 2px 4px rgba(0,0,0,0.1);
7+
8+
$ux-box-shadow-top: 0 -2px 5px $ux-navbar-shadow-color;
9+
$ux-box-shadow-top-light: 0 -1px 1px $ux-navbar-shadow-color;

scss/buttons.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
@import './palette';
2+
3+
.btn-link--neutral {
4+
color: $ux-gray-500;
5+
6+
&:hover {
7+
color: $ux-gray-700;
8+
}
9+
}

scss/navbar.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
$ui-navbar-height: 3rem;
2+
$ui-navbar-height-mobile: $ui-navbar-height;

scss/theme.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
@import './box_shadow';
2+
@import './buttons';
13
@import './lists';
4+
@import './navbar';
25
@import './palette';
36
@import './typography';
47
@import './z_stack';

spec/Flash/Flash.test.jsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import React from 'react';
2+
import { create } from 'react-test-renderer';
3+
4+
import Flash from '../../src/Flash/Flash';
5+
6+
describe('Flash', () => {
7+
test('no header classes', () => {
8+
const { props } = create(<Flash header messages={[]} />).toJSON();
9+
10+
expect(props.className).toContain('Flash');
11+
expect(props.className).not.toContain('Flash--no-header');
12+
});
13+
14+
test('header classes', () => {
15+
const { props } = create(<Flash header={false} messages={[]} />).toJSON();
16+
17+
expect(props.className).toContain('Flash');
18+
expect(props.className).toContain('Flash--no-header');
19+
});
20+
});
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`test withFlash it can create a new flash message 1`] = `
4+
Array [
5+
<div
6+
className="alert alert-success"
7+
>
8+
<button
9+
className="close"
10+
onClick={[Function]}
11+
type="button"
12+
>
13+
×
14+
</button>
15+
This is just a test...
16+
</div>,
17+
<div />,
18+
]
19+
`;

0 commit comments

Comments
 (0)