@talxis/base-controls 1.2501.5 → 1.2501.7

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/index.d.ts CHANGED
@@ -77,6 +77,27 @@ interface IFluentDesignState extends ComponentFramework.FluentDesignState {
77
77
  */
78
78
  applicationTheme?: ITheme;
79
79
  }
80
+ declare class ControlTheme {
81
+ static GetV8ThemeFromFluentDesignLanguage(fluentDesignLanguage?: IFluentDesignState): ITheme;
82
+ static GenerateFluentDesignLanguage(primaryColor: string, backgroundColor: string, textColor: string, options?: {
83
+ v8FluentOverrides?: DeepPartial<ITheme>;
84
+ applicationTheme?: ITheme;
85
+ }): IFluentDesignState;
86
+ }
87
+
88
+ declare const useControlTheme: (fluentDesignLanguage?: IFluentDesignState) => ITheme$1;
89
+
90
+ declare const useControlThemeGenerator: (primaryColor: string, backgroundColor: string, textColor: string, options?: {
91
+ /**
92
+ * Optional overrides that will get applied when v8 theme is generated from fluentDesignLanguage
93
+ */
94
+ v8FluentOverrides?: DeepPartial<ITheme$1>;
95
+ /**
96
+ * The application's theme may differ from the control's theme. This is often the case when rendering a PCF as a cell customizer with conditional formatting.
97
+ * This object allows you to set application theme so PCF's can use it to render surfaces accurately.
98
+ */
99
+ applicationTheme?: ITheme$1;
100
+ }) => IFluentDesignState;
80
101
 
81
102
  interface IOutputs$1 {
82
103
  [key: string]: any;
@@ -199,8 +220,6 @@ declare const useInputBasedControl: <TValue, TParameters extends IInputParameter
199
220
 
200
221
  declare const useMouseOver: (ref: React.RefObject<HTMLElement>) => boolean;
201
222
 
202
- declare const useControlTheme: (fluentDesignLanguage?: IFluentDesignState) => ITheme$1;
203
-
204
223
  declare const getDefaultDateTimeTranslations: (dateFormattingInfo: ComponentFramework.UserSettingApi.DateFormattingInfo) => {
205
224
  time: {
206
225
  1029: string;
@@ -894,4 +913,4 @@ interface IDatasetControl extends IControl<IGridParameters, IGridOutputs, Partia
894
913
 
895
914
  declare const DatasetControl: (props: IDatasetControl) => JSX.Element;
896
915
 
897
- export { DatasetControl, DateTime, Decimal, Duration, Grid, IContext, IControl, IControlController, IDatasetControl, IDateTime, IDateTimeOutputs, IDateTimeParameters, IDateTimeProperty, IDecimal, IDecimalNumberProperty, IDecimalOutputs, IDecimalParameters, IDefaultTranslations, IDuration, IDurationOutputs, IDurationParameters, IEntity, IGrid, IGridOutputs, IGridParameters, ILayout, ILookup, ILookupOutputs, ILookupParameters, ILookupProperty, IMetadata, IMultiSelectOptionSet, IMultiSelectOptionSetOutputs, IMultiSelectOptionSetParameters, IMultiSelectOptionSetProperty, IOptionSet, IOptionSetOutputs, IOptionSetParameters, IOptionSetProperty, IOutputs, IParameters$1 as IParameters, IProperty, IStringProperty, ITextField, ITextFieldOutputs, ITextFieldParameters, ITranslation, ITranslations, ITwoOptions, ITwoOptionsOutputs, ITwoOptionsParameters, ITwoOptionsProperty, IWholeNumberProperty, Lookup, MultiSelectOptionSet, OptionSet, TextField, TwoOptions, useControl, useControlSizing, useControlTheme, useDateTime, useFocusIn, useInputBasedControl, useLookup, useMouseOver };
916
+ export { ControlTheme, DatasetControl, DateTime, Decimal, Duration, Grid, IContext, IControl, IControlController, IDatasetControl, IDateTime, IDateTimeOutputs, IDateTimeParameters, IDateTimeProperty, IDecimal, IDecimalNumberProperty, IDecimalOutputs, IDecimalParameters, IDefaultTranslations, IDuration, IDurationOutputs, IDurationParameters, IEntity, IFluentDesignState, IGrid, IGridOutputs, IGridParameters, ILayout, ILookup, ILookupOutputs, ILookupParameters, ILookupProperty, IMetadata, IMultiSelectOptionSet, IMultiSelectOptionSetOutputs, IMultiSelectOptionSetParameters, IMultiSelectOptionSetProperty, IOptionSet, IOptionSetOutputs, IOptionSetParameters, IOptionSetProperty, IOutputs, IParameters$1 as IParameters, IProperty, IStringProperty, ITextField, ITextFieldOutputs, ITextFieldParameters, ITranslation, ITranslations, ITwoOptions, ITwoOptionsOutputs, ITwoOptionsParameters, ITwoOptionsProperty, IWholeNumberProperty, Lookup, MultiSelectOptionSet, OptionSet, TextField, TwoOptions, useControl, useControlSizing, useControlTheme, useControlThemeGenerator, useDateTime, useFocusIn, useInputBasedControl, useLookup, useMouseOver };
package/dist/index.js CHANGED
@@ -4,6 +4,8 @@ export { useFocusIn } from './hooks/useFocusIn.js';
4
4
  export { useInputBasedControl } from './hooks/useInputBasedControl.js';
5
5
  export { useMouseOver } from './hooks/useMouseOver.js';
6
6
  export { useControlTheme } from './utils/theme/hooks/useControlTheme.js';
7
+ export { ControlTheme } from './utils/theme/ControlTheme.js';
8
+ export { useControlThemeGenerator } from './utils/theme/hooks/useControlThemeGenerator.js';
7
9
  export { DateTime } from './components/DateTime/DateTime.js';
8
10
  export { useDateTime } from './components/DateTime/hooks/useDateTime.js';
9
11
  export { Decimal } from './components/Decimal/Decimal.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}
@@ -1,2 +1,4 @@
1
1
  export { ControlTheme } from './theme/ControlTheme.js';
2
+ export { useControlTheme } from './theme/hooks/useControlTheme.js';
3
+ export { useControlThemeGenerator } from './theme/hooks/useControlThemeGenerator.js';
2
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -0,0 +1,2 @@
1
+ export * from './useControlTheme';
2
+ export * from './useControlThemeGenerator';
@@ -0,0 +1,3 @@
1
+ export { useControlTheme } from './useControlTheme.js';
2
+ export { useControlThemeGenerator } from './useControlThemeGenerator.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,11 @@
1
+ import { useMemo } from 'react';
2
+ import { ControlTheme } from '../ControlTheme.js';
3
+
4
+ const useControlThemeGenerator = (primaryColor, backgroundColor, textColor, options) => {
5
+ return useMemo(() => {
6
+ return ControlTheme.GenerateFluentDesignLanguage(primaryColor, backgroundColor, textColor, options);
7
+ }, [primaryColor, backgroundColor, textColor]);
8
+ };
9
+
10
+ export { useControlThemeGenerator };
11
+ //# sourceMappingURL=useControlThemeGenerator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useControlThemeGenerator.js","sources":["../../../../src/utils/theme/hooks/useControlThemeGenerator.ts"],"sourcesContent":["import { useMemo } from \"react\"\nimport { ControlTheme, IFluentDesignState } from \"../ControlTheme\"\nimport { DeepPartial } from \"@talxis/client-libraries\"\nimport { ITheme } from \"@fluentui/react\"\n\nexport const useControlThemeGenerator = (primaryColor: string, backgroundColor: string, textColor: string, options?: {\n /**\n * Optional overrides that will get applied when v8 theme is generated from fluentDesignLanguage\n */\n v8FluentOverrides?: DeepPartial<ITheme>;\n /**\n * The application's theme may differ from the control's theme. This is often the case when rendering a PCF as a cell customizer with conditional formatting.\n * This object allows you to set application theme so PCF's can use it to render surfaces accurately.\n */\n applicationTheme?: ITheme;\n}): IFluentDesignState => {\n return useMemo(() => {\n return ControlTheme.GenerateFluentDesignLanguage(primaryColor, backgroundColor, textColor, options)\n }, [primaryColor, backgroundColor, textColor])\n}"],"names":[],"mappings":";;;AAKO,MAAM,wBAAwB,GAAG,CAAC,YAAoB,EAAE,eAAuB,EAAE,SAAiB,EAAE,OAU1G,KAAwB;IACrB,OAAO,OAAO,CAAC,MAAK;AAChB,QAAA,OAAO,YAAY,CAAC,4BAA4B,CAAC,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,OAAO,CAAC,CAAA;KACtG,EAAE,CAAC,YAAY,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC,CAAA;AAClD;;;;"}
@@ -1 +1,2 @@
1
1
  export * from './ControlTheme';
2
+ export * from './hooks';
@@ -1,2 +1,4 @@
1
1
  export { ControlTheme } from './ControlTheme.js';
2
+ export { useControlTheme } from './hooks/useControlTheme.js';
3
+ export { useControlThemeGenerator } from './hooks/useControlThemeGenerator.js';
2
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@talxis/base-controls",
3
- "version": "1.2501.5",
3
+ "version": "1.2501.7",
4
4
  "description": "Set of React components that natively work with Power Apps Component Framework API's",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",