@databrainhq/plugin 0.14.11 → 0.14.12

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,5 +1,6 @@
1
1
  import React, { HTMLAttributes } from 'react';
2
2
  import { ThemeType } from '@/utils/theme';
3
+ import { AdminThemeOptionsType } from '@/types';
3
4
  /**
4
5
  * token - The client based guest token (required).
5
6
  * dashboardId - The id of the dashboard you want to see.
@@ -33,6 +34,7 @@ export interface DashboardProps extends HTMLAttributes<HTMLElement> {
33
34
  enableMultiMetricFilters?: boolean;
34
35
  disableFullscreen?: boolean;
35
36
  optionsIcon?: 'kebab-menu-vertical' | 'download';
37
+ adminThemeOptions?: AdminThemeOptionsType;
36
38
  }
37
39
  /**
38
40
  * @name Dashboard - A react component to display the dashboard.
@@ -46,4 +48,4 @@ export interface DashboardProps extends HTMLAttributes<HTMLElement> {
46
48
  * @prop {boolean} enableMultiMetricFilters (optional) - Whether to allow multiple metric filters in metric card.
47
49
  * @prop {object} theme (optional) - A theme object to customize the theme.
48
50
  */
49
- export declare const Dashboard: ({ token, options, theme, dashboardId, isHideChartSettings, isHideTablePreview, enableDownloadCsv, enableEmailCsv, enableMultiMetricFilters, disableFullscreen, optionsIcon, }: DashboardProps) => React.JSX.Element;
51
+ export declare const Dashboard: ({ token, options, theme, dashboardId, isHideChartSettings, isHideTablePreview, enableDownloadCsv, enableEmailCsv, enableMultiMetricFilters, disableFullscreen, optionsIcon, adminThemeOptions, }: DashboardProps) => React.JSX.Element;
@@ -1,7 +1,9 @@
1
1
  import React, { PropsWithChildren } from 'react';
2
+ import { AdminThemeOptionsType } from '@/types';
2
3
  type DashboardProviderProps = PropsWithChildren & {
3
4
  token: string;
4
5
  dashboardId?: string;
6
+ adminTheme?: AdminThemeOptionsType;
5
7
  };
6
- declare const DashboardProvider: ({ token, dashboardId, children, }: DashboardProviderProps) => React.JSX.Element;
8
+ declare const DashboardProvider: ({ token, dashboardId, children, adminTheme, }: DashboardProviderProps) => React.JSX.Element;
7
9
  export default DashboardProvider;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { ThemeType } from '@/utils';
3
+ import { AdminThemeOptionsType } from '@/types';
3
4
  export interface EmbeddedDashboardProps {
4
5
  options?: {
5
6
  disableMetricCreation?: boolean;
@@ -17,5 +18,6 @@ export interface EmbeddedDashboardProps {
17
18
  optionsIcon?: 'kebab-menu-vertical' | 'download';
18
19
  };
19
20
  theme?: ThemeType;
21
+ adminThemeOption?: AdminThemeOptionsType;
20
22
  }
21
- export declare const EmbeddedDashboard: React.MemoExoticComponent<({ options, theme }: EmbeddedDashboardProps) => React.JSX.Element>;
23
+ export declare const EmbeddedDashboard: React.MemoExoticComponent<({ options, theme, adminThemeOption }: EmbeddedDashboardProps) => React.JSX.Element>;
@@ -1,6 +1,7 @@
1
- declare const useNewEmbeddedDashboard: ({ token, dashboardId, }: {
1
+ declare const useNewEmbeddedDashboard: ({ token, dashboardId, adminThemeOption, }: {
2
2
  token: string;
3
3
  dashboardId?: string | undefined;
4
+ adminThemeOption?: any;
4
5
  }) => {
5
6
  isLoading: boolean;
6
7
  error: string | undefined;
@@ -466,3 +466,38 @@ export type FilterClausesType = (dependOn: FloatingDropDownOption[]) => {
466
466
  columnName: string;
467
467
  value: string | string[];
468
468
  }[];
469
+ export type AdminThemeOptionsType = {
470
+ general: {
471
+ name: string;
472
+ fontFamily: string;
473
+ };
474
+ dashboard: {
475
+ backgroundColor?: string;
476
+ ctaColor?: string;
477
+ ctaTextColor?: string;
478
+ selectBoxSize?: 'small' | 'medium' | 'large';
479
+ selectBoxVariant?: 'floating' | 'static';
480
+ selectBoxBorderRadius?: string;
481
+ };
482
+ cardDescription: {
483
+ fontSize?: string;
484
+ fontWeight?: string;
485
+ color?: string;
486
+ };
487
+ cardTitle: {
488
+ fontSize?: string;
489
+ fontWeight?: string;
490
+ color?: string;
491
+ };
492
+ chart: {
493
+ palettes?: {
494
+ name: string;
495
+ colors: string[];
496
+ }[];
497
+ selected?: string;
498
+ };
499
+ cardCustomization: {
500
+ padding?: string;
501
+ borderRadius?: string;
502
+ };
503
+ };