@reuters-graphics/graphics-components 3.0.8 → 3.0.9
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/dist/components/Theme/@types/component.d.ts +2 -2
- package/dist/components/Theme/Theme.svelte +2 -2
- package/dist/components/Theme/Theme.svelte.d.ts +4 -4
- package/dist/components/Theme/themes/common.js +1 -1
- package/dist/components/Theme/themes/dark.js +1 -1
- package/dist/components/Theme/themes/light.js +1 -1
- package/dist/components/Theme/utils/merge.d.ts +2 -2
- package/package.json +1 -1
|
@@ -37,11 +37,11 @@ export interface CustomFont {
|
|
|
37
37
|
family?: Partial<FontFamily>;
|
|
38
38
|
size?: Partial<FontSize>;
|
|
39
39
|
}
|
|
40
|
-
export interface
|
|
40
|
+
export interface ThemeConfig {
|
|
41
41
|
colour: Colour;
|
|
42
42
|
font: Font;
|
|
43
43
|
}
|
|
44
|
-
export interface
|
|
44
|
+
export interface CustomThemeConfig {
|
|
45
45
|
colour?: Partial<Colour>;
|
|
46
46
|
font?: Partial<CustomFont>;
|
|
47
47
|
[customProperty: string]: unknown;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
import mergeThemes from './utils/merge.js';
|
|
15
15
|
|
|
16
16
|
// Types
|
|
17
|
-
import type {
|
|
17
|
+
import type { CustomThemeConfig, ThemeConfig } from './@types/component';
|
|
18
18
|
import type { Snippet } from 'svelte';
|
|
19
19
|
type Base = 'light' | 'dark';
|
|
20
20
|
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
/** Custom theme object. Can be a partial theme with just
|
|
23
23
|
* what you want to change.
|
|
24
24
|
*/
|
|
25
|
-
theme?:
|
|
25
|
+
theme?: CustomThemeConfig | ThemeConfig;
|
|
26
26
|
/**
|
|
27
27
|
* Base theme is one of `light` or `dark` and will be merged
|
|
28
28
|
* with your custom theme to fill in any values you don't
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
* Pre-made themes you can import.
|
|
3
3
|
*/
|
|
4
4
|
export declare const themes: {
|
|
5
|
-
light:
|
|
6
|
-
dark:
|
|
5
|
+
light: ThemeConfig;
|
|
6
|
+
dark: ThemeConfig;
|
|
7
7
|
};
|
|
8
|
-
import type {
|
|
8
|
+
import type { CustomThemeConfig, ThemeConfig } from './@types/component';
|
|
9
9
|
import type { Snippet } from 'svelte';
|
|
10
10
|
type Base = 'light' | 'dark';
|
|
11
11
|
interface Props {
|
|
12
12
|
/** Custom theme object. Can be a partial theme with just
|
|
13
13
|
* what you want to change.
|
|
14
14
|
*/
|
|
15
|
-
theme?:
|
|
15
|
+
theme?: CustomThemeConfig | ThemeConfig;
|
|
16
16
|
/**
|
|
17
17
|
* Base theme is one of `light` or `dark` and will be merged
|
|
18
18
|
* with your custom theme to fill in any values you don't
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @type {Omit<import('../@types/component').
|
|
1
|
+
/** @type {Omit<import('../@types/component').ThemeConfig, "colour">} */
|
|
2
2
|
/* Generated from
|
|
3
3
|
https://www.fluid-type-scale.com/calculate?minFontSize=18&minWidth=320&minRatio=1.125&maxFontSize=21&maxWidth=1280&maxRatio=1.25&steps=xxs%2Cxs%2Csm%2Cbase%2Clg%2Cxl%2C2xl%2C3xl%2C4xl%2C5xl%2C6xl&baseStep=base&prefix=&decimals=2&useRems=on&remValue=16&previewFont=Noto+Sans&previewText=Almost+before+we+knew+it%2C+we+had+left+the+ground&previewWidth=0
|
|
4
4
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ThemeConfig, CustomThemeConfig } from '../@types/component';
|
|
2
2
|
/**
|
|
3
3
|
* Deep merges theme objects.
|
|
4
4
|
*/
|
|
5
|
-
export default function merge<T extends Record<string, unknown>>(target: T, ...sources: (
|
|
5
|
+
export default function merge<T extends Record<string, unknown>>(target: T, ...sources: (ThemeConfig | CustomThemeConfig)[]): T;
|