gatsby-core-theme 6.1.0 → 6.1.6

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 CHANGED
@@ -1,3 +1,72 @@
1
+ ## [6.1.6](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v6.1.5...v6.1.6) (2022-04-18)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * commit to trigger publish ([6c6c3fb](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/6c6c3fb19ff72f175da8843c02cc467033211097))
7
+
8
+ ## [6.1.5](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v6.1.4...v6.1.5) (2022-04-18)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * changed npm token ([eba1721](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/eba17217edfaa65a57f0fc911341ae040df4e2df))
14
+
15
+
16
+ * Merge branch 'master' of git.ilcd.rocks:team-floyd/themes/gatsby-themes ([44e4e94](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/44e4e940745311f4435de7e965394481a0e13e21))
17
+
18
+ ## [6.1.4](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v6.1.3...v6.1.4) (2022-04-18)
19
+
20
+
21
+ ### Bug Fixes
22
+
23
+ * changed tracker ([4ed35aa](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/4ed35aa6ccdad19fdf9e203da67a8a74d78fd662))
24
+
25
+
26
+ * Merge branch 'master' of git.ilcd.rocks:team-floyd/themes/gatsby-themes ([43f8dcf](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/43f8dcf4f647f3f7128c10bfcc73482876129890))
27
+
28
+ ## [6.1.3](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v6.1.2...v6.1.3) (2022-04-18)
29
+
30
+
31
+ ### Bug Fixes
32
+
33
+ * star rating fixed design ([eaf7472](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/eaf74723c83f203e465d5cc3811cca562134b3ef))
34
+
35
+
36
+ * Merge branch 'tm-2783-fix-star-rating' into 'master' ([3f1d310](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/3f1d3105db166d2bbdd48c2a2d19bb0c1e3a462e))
37
+
38
+ ## [6.1.2](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v6.1.1...v6.1.2) (2022-04-13)
39
+
40
+
41
+ ### Bug Fixes
42
+
43
+ * add star ratings changes ([a7145f4](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/a7145f4ee6c6e8c73c879e3ea968ef1b5b3566f9))
44
+ * replace h3 with p for heading sequence ([046fd25](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/046fd25173b6293285687c0da4545eb687cfe726))
45
+
46
+
47
+ ### Code Refactoring
48
+
49
+ * seperate one star component ([77e38fc](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/77e38fc9dfb1ec1b8be2a62bfbbad695ba9c46ca))
50
+
51
+
52
+ * Merge branch 'tm-2813-heading-sequence' into 'master' ([1536f72](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/1536f723f30ec5b794222db41fffcd398b3e0688))
53
+ * Merge branch 'fix-star-ratings' into 'master' ([954ff3a](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/954ff3ace386c2165421731ad280e6d8ecd60c94))
54
+
55
+
56
+ ### Tests
57
+
58
+ * added test for onestar ([0f21ec6](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/0f21ec6ae1ae0133450ba1d15c442469c4abf18d))
59
+
60
+ ## [6.1.1](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v6.1.0...v6.1.1) (2022-04-06)
61
+
62
+
63
+ ### Code Refactoring
64
+
65
+ * replace deprecated with calc in style ([411f685](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/411f685825d020414f76550399ddfeba47903073))
66
+
67
+
68
+ * Merge branch 'tm-2812-fix-sasserrors' into 'master' ([7254b1e](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/7254b1e75029a73ebc2daa76df9e4afefb857428))
69
+
1
70
  # [6.1.0](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v6.0.1...v6.1.0) (2022-04-06)
2
71
 
3
72
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "6.1.0",
3
+ "version": "6.1.6",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "main": "index.js",
6
6
  "GATSBY_RECAPTCHA_SITEKEY": "6LfoyvMUAAAAAO4nl_MQnqHb4XdHxEiu5cXgIqeB",
@@ -52,8 +52,8 @@ export default function OperatorBanner({
52
52
  <LazyImage alt={operator?.name} src={imagePrettyUrl(logo)} />
53
53
  </a>
54
54
  ) : (
55
- <div>
56
- <h3>
55
+ <div className={styles.nameTitle}>
56
+ <p>
57
57
  <a
58
58
  href={prettyLink}
59
59
  title={operator?.name}
@@ -63,7 +63,7 @@ export default function OperatorBanner({
63
63
  >
64
64
  {operator?.name}
65
65
  </a>
66
- </h3>
66
+ </p>
67
67
  {!isPlaceholder && hasStars && (
68
68
  <StarRating numOfStars={5} rating={operator.rating} />
69
69
  )}
@@ -33,7 +33,7 @@
33
33
  }
34
34
 
35
35
  > div:first-child {
36
- h3 a {
36
+ .nameTitle a {
37
37
  @include link-color(var(--color-18));
38
38
  }
39
39
 
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { getRating } from '~helpers/rating';
4
+
5
+ import styles from './one-star.module.scss';
6
+
7
+ const OneStar = ({ numOfStars, rating, active = true }) => (
8
+ <div className={`${styles.starRatingContainer} ${!active && styles.inactive}`}>
9
+ <span className={styles.fullStar} />
10
+ <span className={styles.rateNr}>{`${getRating(rating)}/${numOfStars}`}</span>
11
+ </div>
12
+ );
13
+
14
+ OneStar.propTypes = {
15
+ numOfStars: PropTypes.oneOf([5, 10]).isRequired,
16
+ rating: PropTypes.oneOfType([PropTypes.array, PropTypes.number, PropTypes.string]).isRequired,
17
+ active: PropTypes.bool,
18
+ };
19
+
20
+ export default OneStar;
@@ -0,0 +1,28 @@
1
+ .starRatingContainer {
2
+ @include flex-direction(row);
3
+ justify-content: center;
4
+ background-color: #ffffff;
5
+ min-width: 6.5rem;
6
+ min-height: 2.1rem;
7
+ line-height: 2.1rem;
8
+ border-radius: 0.4rem;
9
+ border: 1px solid var(--main-star-wrapper-color);
10
+
11
+ .fullStar {
12
+ @include star(var(--full-star-fill-color), var(--full-star-border-color), unset, 2.1rem);
13
+ }
14
+
15
+ .rateNr {
16
+ color: #17182f;
17
+ font-weight: 700;
18
+ font-size: 1.3rem;
19
+ margin-left: 0.33rem;
20
+ line-height: 2.1rem;
21
+ }
22
+
23
+ &.inactive {
24
+ .fullStar {
25
+ @include star(var(--empty-star-border-color), var(--empty-star-border-color), unset, 2.1rem);
26
+ }
27
+ }
28
+ }
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { render, cleanup } from '@testing-library/react';
3
+ import '@testing-library/jest-dom/extend-expect';
4
+
5
+ import OneStar from './one-star';
6
+
7
+ describe('OneStar Component', () => {
8
+ test('render container with correct rating', async () => {
9
+ const { container } = render(<OneStar numOfStars={5} rating={3} />);
10
+
11
+ expect(container.querySelectorAll('span')).toHaveLength(2);
12
+ expect(container.querySelectorAll('span')[1].innerHTML).toBe('3/5');
13
+ });
14
+ });
15
+
16
+ afterEach(() => {
17
+ cleanup();
18
+ });
@@ -29,4 +29,4 @@
29
29
  @include half-star(var(--empty-star-border-color), var(--empty-star-border-color), var(--halfEmpty-star-fill-color))
30
30
  }
31
31
  }
32
- }
32
+ }
@@ -65,9 +65,9 @@
65
65
  pointer-events: none;
66
66
  border-color: rgba(0, 0, 0, 0);
67
67
  border-top: $height solid $color;
68
- border-right: $width/2 solid transparent;
69
- border-left: $width/2 solid transparent;
70
- margin-left: -$width/2;
68
+ border-right: calc($width / 2) solid transparent;
69
+ border-left: calc($width / 2) solid transparent;
70
+ margin-left: -calc($width / 2);
71
71
  }
72
72
  }
73
73
 
@@ -85,9 +85,9 @@
85
85
  }
86
86
  }
87
87
 
88
- @mixin star($border-color: #fba62f, $fill-color: #fba62f) {
89
- line-height: 2rem;
90
- width: 16px;
88
+ @mixin star($border-color: #ffb400, $fill-color: #ffb400, $width: 16px, $line-height: 2rem) {
89
+ line-height: $line-height;
90
+ width: $width;
91
91
  font-weight: normal;
92
92
  display: inline-block;
93
93
  color: $fill-color;
@@ -103,8 +103,7 @@
103
103
  }
104
104
  }
105
105
 
106
-
107
- @mixin half-star($border-color: #fba62f, $half-empty-color: #fba62f , $half-full-color: white) {
106
+ @mixin half-star($border-color: #ffb400, $half-empty-color: #ffb400, $half-full-color: white) {
108
107
  line-height: 2rem;
109
108
  width: 16px;
110
109
  font-weight: normal;
@@ -16,6 +16,7 @@
16
16
  --half-star-border-color: #fba62f;
17
17
  --empty-star-fill-color: white;
18
18
  --empty-star-border-color: grey;
19
+ --main-star-wrapper-color: #a5bcf0;
19
20
 
20
21
  // Font
21
22
  --main-font: Nunito;
package/storybook/.ci.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  # ######################
2
- # STORYBOOK CI
2
+ # STORYBOOK
3
3
  # #####################
4
4
 
5
5
  Storybook Build:
@@ -9,7 +9,7 @@ Storybook Build:
9
9
  - floyd-runner-test
10
10
  script:
11
11
  - yarn config set cache-folder .yarn
12
- - npm config set //registry.npmjs.org/:_authToken 32bb5578-6354-4c61-8d7a-d49a4869bc21
12
+ - npm config set //registry.npmjs.org/:_authToken $NPM_AUTH_TOKEN
13
13
  - yarn
14
14
  - yarn workspace gatsby-core-theme build-storybook -o ./storybook/public
15
15
  artifacts: