Skip to content

Commit dfcc167

Browse files
committed
Merge branch 'main' into dependabot/npm_and_yarn/vm2-3.9.19
2 parents 482660d + b7c2d83 commit dfcc167

32 files changed

+7010
-12424
lines changed
File renamed without changes.

package-lock.json

Lines changed: 6632 additions & 12351 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@scientist-softserv/webstore-component-library",
3-
"version": "0.1.17",
3+
"version": "0.1.22",
44
"description": "A React component library intended for use with WebStore applications",
55
"main": "dist/index.js",
66
"module": "dist/index.es.js",
@@ -54,14 +54,14 @@
5454
"@mdx-js/react": "^1.6.22",
5555
"@rollup/plugin-node-resolve": "^15.0.0",
5656
"@storybook/addon-actions": "^6.5.12",
57-
"@storybook/addon-essentials": "^6.5.12",
57+
"@storybook/addon-essentials": "^7.0.4",
5858
"@storybook/addon-interactions": "^6.5.12",
5959
"@storybook/addon-links": "^6.5.12",
6060
"@storybook/builder-webpack4": "^6.5.12",
6161
"@storybook/manager-webpack4": "^6.5.12",
6262
"@storybook/preset-scss": "^1.0.3",
63-
"@storybook/react": "^6.5.12",
64-
"@storybook/test-runner": "^0.7.2",
63+
"@storybook/react": "^7.0.4",
64+
"@storybook/test-runner": "^0.10.0",
6565
"babel-loader": "^8.2.5",
6666
"css-loader": "^5.2.7",
6767
"eslint": "^8.23.1",

src/assets/img/thank-you.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ Our icons were sourced from the following:
1111
* [Twitter social badge icons created by Freepik - Flaticon](https://www.flaticon.com/free-icons/twitter-social-badge)
1212
* [Vimeo icons created by Md Tanvirul Haque - Flaticon](https://www.flaticon.com/free-icons/vimeo)
1313
* [Youtube icons created by Freepik - Flaticon](https://www.flaticon.com/free-icons/youtube)
14+
* [LinkedIn icons created by mohammed mahdi - Flaticon](https://www.flaticon.com/free-icons/mass-media)

src/assets/svg/LinkedIn.jsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import * as React from 'react'
2+
3+
const LinkedIn = ({ height, fill }) => (
4+
<svg
5+
height={height}
6+
width={height}
7+
fill={fill}
8+
viewBox='0 0 144 144'
9+
xmlns='http://www.w3.org/2000/svg'
10+
>
11+
<path d='M67.5 0h9c.4.1.7.2 1.1.2 10.8.8 21 3.8 30.3 9.4 19.1 11.4 30.9 28 35 50 .5 2.6.7 5.3 1.1 7.9v9c-.1.4-.2.7-.2 1.1-.9 12.3-4.8 23.7-11.7 34-11.5 17-27.3 27.5-47.6 31.3-2.7.5-5.4.8-8 1.1h-9c-.4-.1-.7-.2-1.1-.2-14.3-1.1-27.3-6.1-38.6-14.9-14.5-11.5-23.5-26.4-26.7-44.6-.5-2.6-.7-5.2-1.1-7.8v-9l.6-5.1c2.1-14.7 8-27.6 18-38.6C29.7 11.5 43.4 3.9 59.7 1.1 62.3.6 64.9.4 67.5 0zm41.8 107.6c0-.3.1-.5.1-.7 0-11.5.1-23.1-.1-34.6 0-2.1-.7-4.4-1.5-6.4-5.3-11.9-22.5-13.6-30.7-3.2-.3.4-.6.8-1 1.2-.1 0-.2-.1-.3-.1v-6.4H61v50.2h15.6V83.1c0-1.6 0-3.3.1-4.9.2-2.6 1.4-4.8 3.4-6.6 4.8-4.2 11.4-2.3 13 3.9.4 1.5.5 3.1.5 4.7v27.4h15.7zm-57.8 0V57.5H35.6v50.1h15.9zm-8-56.9c5 0 9-4 9.1-9 0-5-4-9-9-9.1-5 0-9 4-9 9s3.9 9 8.9 9.1z' />
12+
</svg>
13+
)
14+
15+
export default LinkedIn

src/assets/svg/ToggleIcon.jsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import * as React from 'react'
2+
import themeColors from '../theme/default-colors.module.scss'
3+
4+
const ToggleIcon = ({ linkColor }, props) => (
5+
<svg
6+
xmlns='http://www.w3.org/2000/svg'
7+
xmlSpace='preserve'
8+
style={{
9+
enableBackground: 'new 0 0 227 163.3',
10+
}}
11+
viewBox='0 0 227 163.3'
12+
fill={themeColors[linkColor]}
13+
width={25}
14+
height={25}
15+
{...props}
16+
>
17+
<path d='M113.1 33h-95C5.8 33-2.1 22.1 2.2 11.3 4.6 5.2 9.3 1.8 15.8 1.1c1.5-.2 3-.1 4.5-.1h185.5c2.2 0 4.4-.1 6.5.3 8.1 1.6 13.6 9.2 12.7 17.2-.8 8.1-7.5 14.3-15.9 14.3-21 .1-42 0-63 .1-11 .1-22 .1-33 .1zM113 65h95c12.7 0 20.7 11.7 15.6 22.6-3.1 6.6-8.5 9.4-15.7 9.4H18.4C5.8 97-2.2 86 2.2 75.1c2.6-6.4 8.3-10 16.3-10.1H113zM113.3 129c31.7 0 63.3-.1 95 0 13.2 0 21.1 13.3 14.5 24.1-3.5 5.8-9 7.9-15.7 7.9-45.8-.1-91.7 0-137.5 0H19.1c-10.7 0-17.9-6.4-18-15.9C1 135.5 8.3 129 19.3 129h94z' />
18+
</svg>
19+
)
20+
21+
export default ToggleIcon

src/assets/theme/bootstrap-preview.scss

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
1-
// these colors and variables match what is in the webstore's theme.module.scss file. this file enables us to see the preview of what these overrides will look like without actually importing these from here into the webstore project. In order to see a preview in storybook of how components will look with custom colors, these values must be updated.
2-
3-
$primary: #333333;
4-
$secondary: #CCCCCC;
5-
$success: #666666;
6-
$info: #999999;
7-
$warning: #2A2A2A;
8-
$danger: #606060;
9-
$light: #F8F9FA;
10-
$dark: #212529;
11-
$white: #FFFFFF;
12-
$black: #000000;
13-
14-
// these imports must be AFTER the theme color overrides above in order to properly override bootstrap's colors, but before the theme maps.
1+
@import './default-colors.module.scss';
2+
// these imports must be AFTER the theme colors override import above in order to properly override bootstrap's colors, but before the theme maps.
153
@import '../../../node_modules/bootstrap/scss/functions';
164
@import '../../../node_modules/bootstrap/scss/variables';
175
@import '../../../node_modules/bootstrap/scss/mixins';
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/**
2+
* This file contains the color variables for the theme. Matching those in each webstore instance's "theme.module.scss" file.
3+
*
4+
* They exist in a "module.scss" file so that they can be imported into our ".scss" AND ".jsx" files.
5+
*/
6+
$primary: #614570;
7+
$secondary: #936AAA;
8+
$light: #F2F2F2;
9+
$dark: #070818;
10+
$success: #B0E298;
11+
$info: #8eb3fc;
12+
$warning: #E9DF00;
13+
$danger: #D20000;
14+
$black: #000000;
15+
$white: #FFFFFF;
16+
17+
:export {
18+
primary: $primary;
19+
secondary: $secondary;
20+
success: $success;
21+
info: $info;
22+
warning: $warning;
23+
danger: $danger;
24+
light: $light;
25+
dark: $dark;
26+
black: $black;
27+
white: $white;
28+
}

src/components/AdditionalInfo/AdditionalInfo.jsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
} from 'react-bootstrap'
66
import { addDays, apiV2CompatibleStrings, convertToBase64 } from '../../resources/utilityFunctions'
77

8-
const AdditionalInfo = ({ backgroundColor, defaultRequiredDate, updateRequestForm }) => {
8+
const AdditionalInfo = ({ backgroundColor, defaultRequiredDate, disabled, updateRequestForm, }) => {
99
const [showProposalDate, setShowProposalDate] = useState(true)
1010
const [files, setFiles] = useState([])
1111
const fileRef = useRef(null)
@@ -55,7 +55,7 @@ const AdditionalInfo = ({ backgroundColor, defaultRequiredDate, updateRequestFor
5555
min={oneDayFromNow}
5656
defaultValue={defaultRequiredDate}
5757
placeholder='Proposals Required By'
58-
disabled={showProposalDate === false}
58+
disabled={(showProposalDate === false) || disabled}
5959
onChange={showProposalDate && ((e) => handleChange(e.target.value))}
6060
required
6161
/>
@@ -70,6 +70,7 @@ const AdditionalInfo = ({ backgroundColor, defaultRequiredDate, updateRequestFor
7070
>
7171
<Form.Check
7272
className='prevent-validation-styles'
73+
disabled={disabled}
7374
type='checkbox'
7475
label='Proposals can be submitted at any time.'
7576
onChange={() => {
@@ -84,6 +85,7 @@ const AdditionalInfo = ({ backgroundColor, defaultRequiredDate, updateRequestFor
8485
<Form.Label>Attachments:</Form.Label>
8586
<Form.Control
8687
className='prevent-validation-styles'
88+
disabled={disabled}
8789
multiple
8890
type='file'
8991
onChange={handleAddFile}
@@ -110,6 +112,7 @@ const AdditionalInfo = ({ backgroundColor, defaultRequiredDate, updateRequestFor
110112
AdditionalInfo.propTypes = {
111113
backgroundColor: PropTypes.string,
112114
updateRequestForm: PropTypes.func.isRequired,
115+
disabled: PropTypes.bool.isRequired,
113116
}
114117

115118
AdditionalInfo.defaultProps = {
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import React from 'react'
2+
import Form from 'react-bootstrap/Form'
3+
import PropTypes from 'prop-types'
4+
import { useState } from 'react'
5+
6+
const CookiePreferencesCheck = ({ cookieConsentValue, disableCookies, enableCookies }) => {
7+
// NOTE: the enable/disable cookies functions change the actual value.
8+
// the state variable below is so the radio buttons update after being clicked.
9+
// NOTE: cookie values are strings. we are parsing it in state so we don't have to
10+
// do strict evaluations (===) with strings in the code below.
11+
const [allowed, setAllowed] = useState(JSON.parse(cookieConsentValue))
12+
13+
const handleEnablingCookies = () => {
14+
enableCookies()
15+
setAllowed(true)
16+
}
17+
18+
const handleDisablingCookies = () => {
19+
disableCookies()
20+
setAllowed(false)
21+
}
22+
23+
return (
24+
<Form>
25+
<Form.Check
26+
inline
27+
label='Allow Cookies'
28+
name='Allow Cookies'
29+
type='radio'
30+
id='allow-cookies'
31+
checked={allowed}
32+
onChange={() => handleEnablingCookies()}
33+
/>
34+
<Form.Check
35+
inline
36+
label='Disable Cookies'
37+
name='Disable Cookies'
38+
type='radio'
39+
id='disable-cookies'
40+
checked={!allowed}
41+
onChange={() => handleDisablingCookies()}
42+
/>
43+
</Form>
44+
);
45+
}
46+
47+
CookiePreferencesCheck.propTypes = {
48+
cookieConsentValue: PropTypes.string.isRequired,
49+
disableCookies: PropTypes.func.isRequired,
50+
enableCookies: PropTypes.func.isRequired,
51+
}
52+
53+
export default CookiePreferencesCheck

0 commit comments

Comments
 (0)