gatsby-matrix-theme 37.0.38 → 37.0.40
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/CHANGELOG.md +26 -0
- package/package.json +2 -2
- package/src/components/atoms/see-more/index.js +48 -0
- package/src/components/atoms/see-more/see-more.module.scss +6 -0
- package/src/components/atoms/see-more/see-more.test.js +54 -0
- package/src/components/atoms/select/index.js +8 -6
- package/src/components/molecules/horse-calculator/horse-calculator.module.scss +448 -109
- package/src/components/molecules/horse-calculator/index.js +161 -165
- package/src/components/organisms/cards/index.js +4 -4
- package/src/components/organisms/cards/module-introduction/index.js +6 -10
- package/src/gatsby-core-theme/components/atoms/module-title/index.js +2 -22
- package/src/gatsby-core-theme/components/atoms/module-title/module-title.module.scss +0 -7
- package/src/gatsby-core-theme/components/molecules/module/module.module.scss +1 -1
- package/src/helpers/horse-racing-calculator/index.js +1 -1
- package/storybook/public/347.512163c1.iframe.bundle.js +1 -0
- package/storybook/public/{631.5f6b1aef.iframe.bundle.js → 631.6bc9ee8d.iframe.bundle.js} +4 -4
- package/storybook/public/{631.5f6b1aef.iframe.bundle.js.map → 631.6bc9ee8d.iframe.bundle.js.map} +1 -1
- package/storybook/public/iframe.html +1 -1
- package/storybook/public/main.4b1eb4ae.iframe.bundle.js +2 -0
- package/storybook/public/{runtime~main.dad8996c.iframe.bundle.js → runtime~main.4b2c10dc.iframe.bundle.js} +1 -1
- package/storybook/public/347.15814dd4.iframe.bundle.js +0 -1
- package/storybook/public/main.17de546f.iframe.bundle.js +0 -2
- /package/storybook/public/{631.5f6b1aef.iframe.bundle.js.LICENSE.txt → 631.6bc9ee8d.iframe.bundle.js.LICENSE.txt} +0 -0
- /package/storybook/public/{main.17de546f.iframe.bundle.js.LICENSE.txt → main.4b1eb4ae.iframe.bundle.js.LICENSE.txt} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
## [37.0.40](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v37.0.39...v37.0.40) (2023-12-20)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* add se more ([e13d11b](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/e13d11b7efc8802fefa576bbd05b5efeb3649db9))
|
|
7
|
+
* create a see more component and reuse it ([9b20b3a](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/9b20b3a8a81317a528b65a033f2c9a4abccb152c))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
* Merge branch 'seeMoreCards' into 'master' ([1f20399](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/1f20399b6997959703111c00788a41ead0dd3c5d))
|
|
11
|
+
|
|
12
|
+
## [37.0.39](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v37.0.38...v37.0.39) (2023-12-20)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* add style ([5fc3b02](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/5fc3b0235fec828e36f6b3bc79702d658bf4f411))
|
|
18
|
+
* dom changes ([452e9eb](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/452e9ebc493417cbb75925ed4d6d313cb0402f57))
|
|
19
|
+
* make style ([84d3d8e](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/84d3d8ebc2e3f08dee6db4cc514d7c95e2271c57))
|
|
20
|
+
* make the structure ([37c7877](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/37c787753059d1bb23e2ca17af5d5be89bd8190e))
|
|
21
|
+
* style ([5528873](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/5528873f61ba9854693c1032368ddc9bcf03dfb6))
|
|
22
|
+
* updated core theme ([4440093](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/4440093f2b3cdbb8396629ec0701d532d71e8385))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
* Merge branch 'tm-3837-horse-calcualtor' into 'master' ([a44087a](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/a44087ab3d48ee8dcb276ba561a773046210abcc))
|
|
26
|
+
|
|
1
27
|
## [37.0.38](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v37.0.37...v37.0.38) (2023-12-19)
|
|
2
28
|
|
|
3
29
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gatsby-matrix-theme",
|
|
3
|
-
"version": "37.0.
|
|
3
|
+
"version": "37.0.40",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"description": "Matrix Theme NPM Package",
|
|
6
6
|
"author": "",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@react-icons/all-files": "^4.1.0",
|
|
27
27
|
"gatsby": "^5.11.0",
|
|
28
|
-
"gatsby-core-theme": "30.0.
|
|
28
|
+
"gatsby-core-theme": "30.0.37",
|
|
29
29
|
"gatsby-plugin-sharp": "^5.11.0",
|
|
30
30
|
"gatsby-plugin-sitemap": "^3.3.0",
|
|
31
31
|
"gatsby-transformer-sharp": "^5.11.0",
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { FaAngleRight } from '@react-icons/all-files/fa/FaAngleRight';
|
|
4
|
+
import styles from './see-more.module.scss';
|
|
5
|
+
import Link from '~hooks/link';
|
|
6
|
+
|
|
7
|
+
export default function SeeMore({
|
|
8
|
+
module,
|
|
9
|
+
viewMoreIcon = <FaAngleRight title="Right-pointing Arrow Icon" />,
|
|
10
|
+
showMoreLink = true,
|
|
11
|
+
}) {
|
|
12
|
+
return (
|
|
13
|
+
<>
|
|
14
|
+
{module.see_more_link?.value && module.see_more_link.type === 'page' && showMoreLink && (
|
|
15
|
+
<Link
|
|
16
|
+
to={module.see_more_link?.path}
|
|
17
|
+
className={`${styles.viewMore || ''} module-title-gtm`}
|
|
18
|
+
>
|
|
19
|
+
{module.see_more_link?.title}
|
|
20
|
+
{viewMoreIcon}
|
|
21
|
+
</Link>
|
|
22
|
+
)}
|
|
23
|
+
{module.see_more_link?.value && module.see_more_link.type === 'external' && showMoreLink && (
|
|
24
|
+
<a
|
|
25
|
+
href={module.see_more_link?.path}
|
|
26
|
+
rel="nofollow"
|
|
27
|
+
className={`${styles.viewMore || ''} module-title-gtm`}
|
|
28
|
+
>
|
|
29
|
+
{module.see_more_link?.title}
|
|
30
|
+
{viewMoreIcon}
|
|
31
|
+
</a>
|
|
32
|
+
)}
|
|
33
|
+
</>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
SeeMore.propTypes = {
|
|
38
|
+
module: PropTypes.shape({
|
|
39
|
+
see_more_link: PropTypes.shape({
|
|
40
|
+
path: PropTypes.string,
|
|
41
|
+
value: PropTypes.number,
|
|
42
|
+
title: PropTypes.string,
|
|
43
|
+
type: PropTypes.string,
|
|
44
|
+
}),
|
|
45
|
+
}),
|
|
46
|
+
viewMoreIcon: PropTypes.element,
|
|
47
|
+
showMoreLink: PropTypes.bool,
|
|
48
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import '@testing-library/jest-dom/extend-expect'; // for additional matchers
|
|
4
|
+
import SeeMore from '.';
|
|
5
|
+
|
|
6
|
+
describe('SeeMore Component', () => {
|
|
7
|
+
test('renders external link when type is external', () => {
|
|
8
|
+
const module = {
|
|
9
|
+
see_more_link: {
|
|
10
|
+
path: 'https://example.com',
|
|
11
|
+
value: 1,
|
|
12
|
+
title: 'External Link',
|
|
13
|
+
type: 'external',
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
render(<SeeMore module={module} showMoreLink />);
|
|
18
|
+
|
|
19
|
+
const externalLink = screen.getByRole('link', { name: /External Link/i });
|
|
20
|
+
expect(externalLink).toHaveAttribute('href', 'https://example.com');
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
test('renders internal link when type is page', () => {
|
|
24
|
+
const module = {
|
|
25
|
+
see_more_link: {
|
|
26
|
+
path: '/internal-page',
|
|
27
|
+
value: 2,
|
|
28
|
+
title: 'Internal Link',
|
|
29
|
+
type: 'page',
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
render(<SeeMore module={module} showMoreLink />);
|
|
34
|
+
|
|
35
|
+
const internalLink = screen.getByRole('link', { name: /Internal Link/i });
|
|
36
|
+
expect(internalLink).toHaveAttribute('href', '/internal-page');
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
test('does not render link when showMoreLink is false', () => {
|
|
40
|
+
const module = {
|
|
41
|
+
see_more_link: {
|
|
42
|
+
path: '/should-not-render',
|
|
43
|
+
value: 3,
|
|
44
|
+
title: 'Should Not Render',
|
|
45
|
+
type: 'page',
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
render(<SeeMore module={module} showMoreLink={false} />);
|
|
50
|
+
|
|
51
|
+
const link = screen.queryByRole('link', { name: /Should Not Render/i });
|
|
52
|
+
expect(link).not.toBeInTheDocument();
|
|
53
|
+
});
|
|
54
|
+
});
|
|
@@ -40,7 +40,14 @@ export default function Select({
|
|
|
40
40
|
|
|
41
41
|
return (
|
|
42
42
|
<label htmlFor={id}>
|
|
43
|
-
|
|
43
|
+
<div>
|
|
44
|
+
{translate(translations, id, label)}
|
|
45
|
+
{tooltip && (
|
|
46
|
+
<Tooltip content={translate(translations, `${id}_tooltip`, tooltip)}>
|
|
47
|
+
<BsQuestionCircle size="2.6rem" title="Question Icon" />
|
|
48
|
+
</Tooltip>
|
|
49
|
+
)}
|
|
50
|
+
</div>
|
|
44
51
|
<div
|
|
45
52
|
className={`${styles?.dropdownStyling || ''} ${
|
|
46
53
|
tooltip ? styles.tooltip || '' : styles.fullWidth || ''
|
|
@@ -49,11 +56,6 @@ export default function Select({
|
|
|
49
56
|
<select ref={refObj} onChange={(e) => onChangeFunc(e, index)} id={id}>
|
|
50
57
|
{options.map((option) => option)}
|
|
51
58
|
</select>
|
|
52
|
-
{tooltip && (
|
|
53
|
-
<Tooltip content={translate(translations, `${id}_tooltip`, tooltip)}>
|
|
54
|
-
<BsQuestionCircle size="2.6rem" title="Question Icon" />
|
|
55
|
-
</Tooltip>
|
|
56
|
-
)}
|
|
57
59
|
</div>
|
|
58
60
|
</label>
|
|
59
61
|
);
|