gatsby-matrix-theme 53.13.5 → 53.14.0

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.
@@ -106,6 +106,12 @@ module.exports = {
106
106
  `./__mocks__/virtual-lazy-client-sync-requires.js`
107
107
  );
108
108
  config.resolve.mainFields = ['browser', 'module', 'main'];
109
+ config.module.rules.push({
110
+ test: /\.m?js/,
111
+ resolve: {
112
+ fullySpecified: false,
113
+ },
114
+ });
109
115
  return config;
110
116
  },
111
117
  };
package/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ # [53.14.0](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/compare/v53.13.5...v53.14.0) (2026-04-14)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * use text from props, generatePlaceholder should be used in prop ([9a756b4](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/9a756b45dbc7c4bab0e771fa60a714b1413e3755))
7
+
8
+
9
+ * Merge branch 'en-416-verification-elements' into 'master' ([b781768](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/b7817680930d70e33bd17a8084f9389db5f4b382))
10
+
11
+
12
+ ### Features
13
+
14
+ * add CSS variables to verification badge for child theme overrides ([811fbdf](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/811fbdf6a919e6cea56e7e6eb2f2e142299d4de7))
15
+ * add directional CSS variable overrides for verification badge positioning ([28c466c](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/28c466ccfca7472ffbe9718fe557f2e9584069ed))
16
+ * add verification flag badge to operator details and fix hydration mismatch ([b9b8e67](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/b9b8e670fe5a96061e9439d4931e6be64affd764))
17
+ * verification badge templates ([92766ad](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/92766adc310cb86b09ebaaaddca63847cb354787))
18
+
1
19
  ## [53.13.5](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/compare/v53.13.4...v53.13.5) (2026-04-08)
2
20
 
3
21
 
package/jest.config.js CHANGED
@@ -26,7 +26,7 @@ module.exports = {
26
26
  '^gatsby-core-utils/(.*)$': `gatsby-core-utils/dist/$1`,
27
27
  },
28
28
  // testPathIgnorePatterns: [`node_modules`, `\\.cache`, `<rootDir>.*/public`],
29
- transformIgnorePatterns: [`node_modules/(?!gatsby-core-theme|gatsby-script|gatsby-link|gatsby)`],
29
+ transformIgnorePatterns: [`node_modules/(?!gatsby-core-theme|gatsby-script|gatsby-link|gatsby|@gigmedia/enigma-utils)`],
30
30
  coveragePathIgnorePatterns: ['src/constants', 'src/components/atoms/admin/card/button'],
31
31
  globals: {
32
32
  __PATH_PREFIX__: ``,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-matrix-theme",
3
- "version": "53.13.5",
3
+ "version": "53.14.0",
4
4
  "main": "index.js",
5
5
  "description": "Matrix Theme NPM Package",
6
6
  "author": "",
@@ -24,6 +24,7 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@react-icons/all-files": "^4.1.0",
27
+ "@gigmedia/enigma-utils": "^1.20.0",
27
28
  "gatsby": "^5.11.0",
28
29
  "gatsby-core-theme": "^44.21.1",
29
30
  "gatsby-plugin-sharp": "^5.11.0",
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import { classNames } from '@gigmedia/enigma-utils';
3
+ import PropTypes from 'prop-types';
4
+ import { generatePlaceholderString } from 'gatsby-core-theme/src/helpers/generators.mjs';
5
+ import useTranslate from '~hooks/useTranslate/useTranslate';
6
+ import styles from './verification-badge.module.scss';
7
+ import VerifyIcon from '../../../../images/icons/verified-author';
8
+
9
+ const VerificationBadge = ({
10
+ text = generatePlaceholderString(`${useTranslate('verified_on', 'Verified on')} [month]`),
11
+ icon = <VerifyIcon color="#3B82F6" />,
12
+ extraClass,
13
+ }) => (
14
+ <div className={classNames([styles.badgeContainer, extraClass])}>
15
+ {icon}
16
+ {text}
17
+ </div>
18
+ );
19
+
20
+ VerificationBadge.propTypes = {
21
+ text: PropTypes.string,
22
+ icon: PropTypes.element,
23
+ extraClass: PropTypes.string,
24
+ };
25
+
26
+ export default VerificationBadge;
@@ -0,0 +1,19 @@
1
+ .badgeContainer {
2
+ display: flex;
3
+ height: var(--verification-badge-height, 20px);
4
+ padding: var(--verification-badge-padding, 6px 8px 6px 4px);
5
+ align-items: center;
6
+ gap: var(--verification-badge-gap, 4px);
7
+ background: var(--verification-badge-background, #cfdeff);
8
+ border-radius: var(--verification-badge-border-radius, 4px);
9
+ width: var(--verification-badge-width, fit-content);
10
+ color: var(--verification-badge-color, #000);
11
+ font-size: var(--verification-badge-font-size, 12px);
12
+ font-weight: var(--verification-badge-font-weight, 400);
13
+ line-height: var(--verification-badge-line-height, 18px);
14
+
15
+ > svg {
16
+ height: var(--verification-badge-icon-size, 14px);
17
+ width: var(--verification-badge-icon-size, 14px);
18
+ }
19
+ }
@@ -0,0 +1,47 @@
1
+ import React from 'react';
2
+ // eslint-disable-next-line import/no-extraneous-dependencies
3
+ import {
4
+ Title,
5
+ Description,
6
+ Primary,
7
+ PRIMARY_STORY,
8
+ ArgsTable,
9
+ } from '@storybook/addon-docs/blocks';
10
+ import VerificationBadge from '.';
11
+
12
+ export default {
13
+ title: 'Theme/Atoms/VerificationBadge/Template One',
14
+ component: VerificationBadge,
15
+ argTypes: {
16
+ text: {
17
+ name: 'text',
18
+ description: 'Translation key for the badge text',
19
+ defaultValue: 'verified_on',
20
+ control: { type: 'text' },
21
+ },
22
+ extraClass: {
23
+ name: 'extraClass',
24
+ description: 'Additional CSS class',
25
+ control: { type: 'text' },
26
+ },
27
+ },
28
+ parameters: {
29
+ docs: {
30
+ description: {
31
+ component: 'A badge that displays a verification status',
32
+ },
33
+ page: () => (
34
+ <>
35
+ <Title />
36
+ <Description />
37
+ <Primary />
38
+ <ArgsTable story={PRIMARY_STORY} />
39
+ </>
40
+ ),
41
+ },
42
+ },
43
+ };
44
+
45
+ const Template = (args) => <VerificationBadge {...args} />;
46
+ export const Default = Template.bind({});
47
+ Default.args = {};
@@ -0,0 +1,45 @@
1
+ import React, { Suspense } from 'react';
2
+ import { render, cleanup } from '@testing-library/react';
3
+
4
+ import VerificationBadge from '.';
5
+ import '@testing-library/jest-dom/extend-expect';
6
+
7
+ jest.mock('../../../../images/icons/verified-author', () => {
8
+ const MockIcon = (props) => <svg data-testid="verify-icon" {...props} />;
9
+ return { __esModule: true, default: MockIcon };
10
+ });
11
+
12
+ const renderWithSuspense = (ui) =>
13
+ render(<Suspense fallback={<div>Loading...</div>}>{ui}</Suspense>);
14
+
15
+ describe('VerificationBadge Component', () => {
16
+ afterEach(() => {
17
+ cleanup();
18
+ });
19
+
20
+ test('renders with default props', async () => {
21
+ const { container, findByText } = renderWithSuspense(<VerificationBadge />);
22
+ await findByText(/Verified on/);
23
+ expect(container.querySelector('.badgeContainer')).toBeInTheDocument();
24
+ });
25
+
26
+ test('renders default translated text', async () => {
27
+ const { findByText } = renderWithSuspense(<VerificationBadge />);
28
+ const element = await findByText(/Verified on/);
29
+ expect(element).toBeInTheDocument();
30
+ });
31
+
32
+ test('renders with custom icon', () => {
33
+ const customIcon = <span data-testid="custom-icon">✓</span>;
34
+ const { getByTestId } = renderWithSuspense(<VerificationBadge icon={customIcon} />);
35
+ expect(getByTestId('custom-icon')).toBeInTheDocument();
36
+ });
37
+
38
+ test('applies extraClass', async () => {
39
+ const { container, findByText } = renderWithSuspense(
40
+ <VerificationBadge extraClass="my-class" />
41
+ );
42
+ await findByText(/Verified on/);
43
+ expect(container.querySelector('.badgeContainer')).toHaveClass('my-class');
44
+ });
45
+ });
@@ -0,0 +1,25 @@
1
+ import React, { lazy } from 'react';
2
+ import { classNames } from '@gigmedia/enigma-utils';
3
+ import PropTypes from 'prop-types';
4
+ import { FaCheckCircle } from '@react-icons/all-files/fa/FaCheckCircle';
5
+ import styles from './verification-badge.module.scss';
6
+
7
+ const FlagIcon = lazy(() => import('../../../../images/icons/country-flag'));
8
+ const VerificationBadge = ({
9
+ flag = <FlagIcon />,
10
+ icon = <FaCheckCircle color="#FFB612" />,
11
+ extraClass,
12
+ }) => (
13
+ <div className={classNames([styles.badgeContainer, extraClass])}>
14
+ {flag}
15
+ {icon}
16
+ </div>
17
+ );
18
+
19
+ VerificationBadge.propTypes = {
20
+ flag: PropTypes.element,
21
+ icon: PropTypes.element,
22
+ extraClass: PropTypes.string,
23
+ };
24
+
25
+ export default VerificationBadge;
@@ -0,0 +1,45 @@
1
+ .badgeContainer {
2
+ display: flex;
3
+ position: relative;
4
+ padding: var(--verification-badge-t2-padding, 2px);
5
+ align-items: flex-start;
6
+ width: var(--verificaction-badge-t2-width, fit-content);
7
+ border-radius: var(--verification-badge-t2-border-radius, 4px);
8
+ background: var(--verification-badge-t2-background, #171f49);
9
+
10
+ &::before {
11
+ content: '';
12
+ width: var(--verification-badge-t2-dot-size, 6px);
13
+ height: var(--verification-badge-t2-dot-size, 6px);
14
+ position: absolute;
15
+ right: var(--verification-badge-t2-dot-right, var(--verification-badge-t2-dot-offset, -1.3px));
16
+ bottom: var(
17
+ --verification-badge-t2-dot-bottom,
18
+ var(--verification-badge-t2-dot-offset, -1.3px)
19
+ );
20
+ background: var(--verification-badge-t2-dot-background, #000);
21
+ border-radius: 100%;
22
+ }
23
+
24
+ > svg {
25
+ &:first-child {
26
+ height: var(--verification-badge-t2-flag-height, 16px);
27
+ width: var(--verification-badge-t2-flag-width, 22px);
28
+ }
29
+
30
+ &:last-child {
31
+ width: var(--verification-badge-t2-icon-size, 8px);
32
+ height: var(--verification-badge-t2-icon-size, 8px);
33
+ position: absolute;
34
+ right: var(
35
+ --verification-badge-t2-icon-right,
36
+ var(--verification-badge-t2-icon-offset, -2px)
37
+ );
38
+ bottom: var(
39
+ --verification-badge-t2-icon-bottom,
40
+ var(--verification-badge-t2-icon-offset, -2px)
41
+ );
42
+ border-radius: 100%;
43
+ }
44
+ }
45
+ }
@@ -0,0 +1,41 @@
1
+ import React from 'react';
2
+ // eslint-disable-next-line import/no-extraneous-dependencies
3
+ import {
4
+ Title,
5
+ Description,
6
+ Primary,
7
+ PRIMARY_STORY,
8
+ ArgsTable,
9
+ } from '@storybook/addon-docs/blocks';
10
+ import VerificationBadge from '.';
11
+
12
+ export default {
13
+ title: 'Theme/Atoms/VerificationBadge/Template Two',
14
+ component: VerificationBadge,
15
+ argTypes: {
16
+ extraClass: {
17
+ name: 'extraClass',
18
+ description: 'Additional CSS class',
19
+ control: { type: 'text' },
20
+ },
21
+ },
22
+ parameters: {
23
+ docs: {
24
+ description: {
25
+ component: 'A badge that displays a country flag with a verification icon',
26
+ },
27
+ page: () => (
28
+ <>
29
+ <Title />
30
+ <Description />
31
+ <Primary />
32
+ <ArgsTable story={PRIMARY_STORY} />
33
+ </>
34
+ ),
35
+ },
36
+ },
37
+ };
38
+
39
+ const Template = (args) => <VerificationBadge {...args} />;
40
+ export const Default = Template.bind({});
41
+ Default.args = {};
@@ -0,0 +1,53 @@
1
+ import React, { Suspense } from 'react';
2
+ import { render, cleanup } from '@testing-library/react';
3
+ import '@testing-library/jest-dom/extend-expect';
4
+
5
+ import VerificationBadge from '.';
6
+
7
+ jest.mock('../../../../images/icons/verified-author', () => {
8
+ const MockIcon = (props) => <svg data-testid="verify-icon" {...props} />;
9
+ return { __esModule: true, default: MockIcon };
10
+ });
11
+
12
+ jest.mock('../../../../images/icons/country-flag', () => {
13
+ const MockFlag = (props) => <svg data-testid="flag-icon" {...props} />;
14
+ return { __esModule: true, default: MockFlag };
15
+ });
16
+
17
+ const renderWithSuspense = (ui) =>
18
+ render(<Suspense fallback={<div>Loading...</div>}>{ui}</Suspense>);
19
+
20
+ describe('VerificationBadge Component', () => {
21
+ afterEach(() => {
22
+ cleanup();
23
+ });
24
+
25
+ test('renders with default props', () => {
26
+ const { container } = renderWithSuspense(<VerificationBadge />);
27
+ expect(container.querySelector('.badgeContainer')).toBeInTheDocument();
28
+ });
29
+
30
+ test('renders with custom icon', () => {
31
+ const customIcon = <span data-testid="custom-icon">✓</span>;
32
+ const { getByTestId } = renderWithSuspense(
33
+ <VerificationBadge icon={customIcon} />
34
+ );
35
+ expect(getByTestId('custom-icon')).toBeInTheDocument();
36
+ });
37
+
38
+ test('renders with custom flag', () => {
39
+ const customFlag = <span data-testid="custom-flag">🏳</span>;
40
+ const { getByTestId } = renderWithSuspense(
41
+ <VerificationBadge flag={customFlag} />
42
+ );
43
+ expect(getByTestId('custom-flag')).toBeInTheDocument();
44
+ });
45
+
46
+ test('applies extraClass', async () => {
47
+ const { container, findByTestId } = renderWithSuspense(
48
+ <VerificationBadge extraClass="my-class" />
49
+ );
50
+ await findByTestId('flag-icon');
51
+ expect(container.querySelector('.badgeContainer')).toHaveClass('my-class');
52
+ });
53
+ });
@@ -13,6 +13,7 @@ import useTranslate from '~hooks/useTranslate/useTranslate';
13
13
  import PrettyLink from '~atoms/pretty-link';
14
14
  import VerifiedAuthor from '../../../images/icons/verified-author';
15
15
  import Author from '../../atoms/author/template-one';
16
+ import VerificationFlagBadge from '../../atoms/verification-badge/template-two';
16
17
  import styles from './operator-details.module.scss';
17
18
 
18
19
  const OperatorDetails = ({
@@ -49,6 +50,7 @@ const OperatorDetails = ({
49
50
  showRoundedRating = false,
50
51
  modulePosition,
51
52
  itemPosition,
53
+ showVerificationBadge = false,
52
54
  }) => {
53
55
  const itemName = item?.name || item?.relation?.name;
54
56
  const status = item?.status || item?.relation?.status;
@@ -138,6 +140,7 @@ const OperatorDetails = ({
138
140
  ${(!useOneStarRating && styles.starRatings) || ''}
139
141
  ${(showRatingLabel && useOneStarRating && styles.ratinglabel) || ''}`}
140
142
  >
143
+ {showVerificationBadge && item?.status === 'active' && <VerificationFlagBadge />}
141
144
  {showRating &&
142
145
  (useOneStarRating ? (
143
146
  <StarRating
@@ -234,6 +237,7 @@ OperatorDetails.propTypes = {
234
237
  showRoundedRating: PropTypes.bool,
235
238
  modulePosition: PropTypes.number,
236
239
  itemPosition: PropTypes.number,
240
+ showVerificationBadge: PropTypes.bool,
237
241
  };
238
242
 
239
243
  export default OperatorDetails;