File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- <script is:inline >
1+ ---
2+ import { chartThemeOptions } from " ../previews/chartTheme" ;
3+
4+ const chartThemeValues = chartThemeOptions .map ((option ) => option .value );
5+ const themeInitScript = `
26 (() => {
37 const storageKey = "starlight-theme";
48 const chartThemeStorageKey = "chartkit-chart-theme";
5- const chartThemes = new Set([
6- "default",
7- "spectrum",
8- "aurora",
9- "verdant",
10- "cupertino",
11- "material",
12- "graphite",
13- "contrast",
14- "midnight",
15- "studio"
16- ]);
9+ const chartThemes = new Set(${JSON .stringify (chartThemeValues )});
1710 const getStoredTheme = () => {
1811 try {
1912 const stored = localStorage.getItem(storageKey);
4235 document.documentElement.dataset.chartTheme = chartTheme;
4336 document.documentElement.style.colorScheme = theme;
4437 })();
45- </script >
38+ ` ;
39+ ---
40+
41+ <script is:inline set:html ={ themeInitScript } />
Original file line number Diff line number Diff line change 1+ import {
2+ proCartesianChartPresetOptions ,
3+ type ProCartesianChartPresetName
4+ } from "@chart-kit/pro/themes" ;
5+
16export type ChartThemePreset =
27 | "default"
38 | "spectrum"
@@ -8,7 +13,8 @@ export type ChartThemePreset =
813 | "graphite"
914 | "contrast"
1015 | "midnight"
11- | "studio" ;
16+ | "studio"
17+ | ProCartesianChartPresetName ;
1218
1319export const chartThemeStorageKey = "chartkit-chart-theme" ;
1420export const chartThemeChangeEvent = "chartkit:chart-theme-change" ;
@@ -26,7 +32,11 @@ export const chartThemeOptions: Array<{
2632 { label : "Graphite" , value : "graphite" } ,
2733 { label : "Contrast" , value : "contrast" } ,
2834 { label : "Midnight" , value : "midnight" } ,
29- { label : "Studio" , value : "studio" }
35+ { label : "Studio" , value : "studio" } ,
36+ ...proCartesianChartPresetOptions . map ( ( option ) => ( {
37+ label : `${ option . title } (Pro)` ,
38+ value : option . id
39+ } ) )
3040] ;
3141
3242export const isChartThemePreset = (
Original file line number Diff line number Diff line change @@ -1041,6 +1041,9 @@ export const Touchable = {
10411041} ;
10421042
10431043export const NativeModules = { } ;
1044+ export const Share = {
1045+ share : ( ) => Promise . resolve ( { action : "sharedAction" } )
1046+ } ;
10441047export const UIManager = { } ;
10451048export const TurboModuleRegistry = {
10461049 get : ( ) => null ,
Original file line number Diff line number Diff line change 22 createChartPreset ,
33 type CartesianChartPresetRegistry
44} from "react-native-chart-kit/v2" ;
5+ import { proCartesianChartPresets } from "@chart-kit/pro/themes" ;
56
67export const showcaseCustomPresets : CartesianChartPresetRegistry = {
78 studio : createChartPreset ( {
@@ -31,5 +32,6 @@ export const showcaseCustomPresets: CartesianChartPresetRegistry = {
3132 legendLabelSize : 12
3233 }
3334 }
34- } )
35+ } ) ,
36+ ...proCartesianChartPresets
3537} ;
You can’t perform that action at this time.
0 commit comments