@seqera/docusaurus-theme-seqera 1.0.15-next.57 → 1.0.15

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.
@@ -1,30 +1,17 @@
1
1
  import React from 'react';
2
- import clsx from 'clsx';
3
- import styles from './styles.module.css';
2
+ import {ThemedComponent} from '@docusaurus/theme-common';
4
3
  export default function ThemedImage(props) {
5
- const {sources, className, alt, ...propsRest} = props;
4
+ const {sources, className: parentClassName, alt, ...propsRest} = props;
6
5
  return (
7
- <>
8
- <img
9
- src={sources.light}
10
- alt={alt}
11
- className={clsx(
12
- styles.themedImage,
13
- styles['themedImage--light'],
14
- className,
15
- )}
16
- {...propsRest}
17
- />
18
- <img
19
- src={sources.dark}
20
- alt={alt}
21
- className={clsx(
22
- styles.themedImage,
23
- styles['themedImage--dark'],
24
- className,
25
- )}
26
- {...propsRest}
27
- />
28
- </>
6
+ <ThemedComponent className={parentClassName}>
7
+ {({theme, className}) => (
8
+ <img
9
+ src={sources[theme]}
10
+ alt={alt}
11
+ className={className}
12
+ {...propsRest}
13
+ />
14
+ )}
15
+ </ThemedComponent>
29
16
  );
30
17
  }
@@ -11,15 +11,3 @@
11
11
  [data-theme='dark'] .themedImage--dark {
12
12
  display: initial;
13
13
  }
14
-
15
- /* Ensure smooth rendering during hydration */
16
- .themedImage {
17
- transition: opacity 0.15s ease-in-out;
18
- }
19
-
20
- /* Prevent layout shift by ensuring both images occupy the same space */
21
- .themedImage--light,
22
- .themedImage--dark {
23
- max-width: 100%;
24
- height: auto;
25
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seqera/docusaurus-theme-seqera",
3
- "version": "1.0.15-next.57",
3
+ "version": "1.0.15",
4
4
  "description": "Seqera docs theme for Docusaurus",
5
5
  "author": "Seqera docs team <education@seqera.io>",
6
6
  "license": "Apache-2.0",
@@ -1,27 +1,21 @@
1
1
 
2
2
 
3
3
  import React, {type ReactNode} from 'react';
4
- import clsx from 'clsx';
4
+ import {ThemedComponent} from '@docusaurus/theme-common';
5
5
  import type {Props} from '@theme/ThemedImage';
6
6
 
7
- import styles from './styles.module.css';
8
-
9
7
  export default function ThemedImage(props: Props): ReactNode {
10
- const {sources, className, alt, ...propsRest} = props;
8
+ const {sources, className: parentClassName, alt, ...propsRest} = props;
11
9
  return (
12
- <>
13
- <img
14
- src={sources.light}
15
- alt={alt}
16
- className={clsx(styles.themedImage, styles['themedImage--light'], className)}
17
- {...propsRest}
18
- />
19
- <img
20
- src={sources.dark}
21
- alt={alt}
22
- className={clsx(styles.themedImage, styles['themedImage--dark'], className)}
23
- {...propsRest}
24
- />
25
- </>
10
+ <ThemedComponent className={parentClassName}>
11
+ {({theme, className}) => (
12
+ <img
13
+ src={sources[theme]}
14
+ alt={alt}
15
+ className={className}
16
+ {...propsRest}
17
+ />
18
+ )}
19
+ </ThemedComponent>
26
20
  );
27
21
  }
@@ -11,15 +11,3 @@
11
11
  [data-theme='dark'] .themedImage--dark {
12
12
  display: initial;
13
13
  }
14
-
15
- /* Ensure smooth rendering during hydration */
16
- .themedImage {
17
- transition: opacity 0.15s ease-in-out;
18
- }
19
-
20
- /* Prevent layout shift by ensuring both images occupy the same space */
21
- .themedImage--light,
22
- .themedImage--dark {
23
- max-width: 100%;
24
- height: auto;
25
- }