@talxis/base-controls 1.2505.7 → 1.2505.8

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.
@@ -41,7 +41,14 @@ const useComboBoxTheme = (props, theme) => {
41
41
  return override;
42
42
  }
43
43
  delete override.semanticColors?.inputBackground;
44
- return override;
44
+ return {
45
+ fonts: {
46
+ medium: {
47
+ fontWeight: 600
48
+ }
49
+ },
50
+ ...override,
51
+ };
45
52
  };
46
53
  const isColorFeatureEnabled = getIsColorFeatureEnabled();
47
54
  const colors = getColors(isColorFeatureEnabled);
@@ -1 +1 @@
1
- {"version":3,"file":"useComboBoxTheme.js","sources":["../../../src/components/OptionSet/useComboBoxTheme.ts"],"sourcesContent":["import { IOptionSet } from \"./interfaces\";\nimport { ITheme } from \"@fluentui/react\";\nimport { DeepPartial } from \"@talxis/client-libraries\";\nimport { Theming, useThemeGenerator } from \"@talxis/react-components\";\n\nexport const useComboBoxTheme = (props: IOptionSet, theme: ITheme): [boolean, ITheme] => {\n const boundValue = props.parameters.value;\n const { Options } = boundValue.attributes;\n const selectedOptionColor = boundValue.attributes.Options.find(x => x.Value === boundValue.raw)?.Color;\n\n const getColors = (colorFeatureEnabled: boolean) => {\n const colors = {\n backgroundColor: theme.semanticColors.bodyBackground,\n textColor: theme.semanticColors.bodyText,\n primaryColor: theme.palette.themePrimary\n }\n if (!colorFeatureEnabled) {\n return colors;\n }\n if (!selectedOptionColor) {\n colors.backgroundColor = theme.semanticColors.inputBackground;\n return colors;\n }\n colors.backgroundColor = selectedOptionColor;\n colors.textColor = Theming.GetTextColorForBackground(selectedOptionColor);\n return colors;\n }\n const getIsColorFeatureEnabled = () => {\n if (props.parameters.EnableOptionSetColors?.raw && Options.find(x => x.Color)) {\n return true;\n }\n return false;\n }\n\n /**\n * Since we are creating new theme for combobox, we need to add the overrides in cases where there is no color feature enabled or no color is selected.\n */\n const getThemeOverride = (colorFeatureEnabled: boolean) => {\n const override: DeepPartial<ITheme> = {\n ...props.context.fluentDesignLanguage?.v8FluentOverrides\n }\n if(!colorFeatureEnabled) {\n return override;\n }\n if(!selectedOptionColor) {\n return override;\n }\n delete override.semanticColors?.inputBackground;\n return override;\n }\n\n const isColorFeatureEnabled = getIsColorFeatureEnabled();\n const colors = getColors(isColorFeatureEnabled);\n const override = getThemeOverride(isColorFeatureEnabled);\n\n const currentTheme = useThemeGenerator(colors.primaryColor, colors.backgroundColor, colors.textColor, override)\n return [isColorFeatureEnabled, currentTheme];\n}"],"names":[],"mappings":";;MAKa,gBAAgB,GAAG,CAAC,KAAiB,EAAE,KAAa,KAAuB;AACpF,IAAA,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC;AAC1C,IAAA,MAAM,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC,UAAU,CAAC;IAC1C,MAAM,mBAAmB,GAAG,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,KAAK,UAAU,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC;AAEvG,IAAA,MAAM,SAAS,GAAG,CAAC,mBAA4B,KAAI;AAC/C,QAAA,MAAM,MAAM,GAAG;AACX,YAAA,eAAe,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc;AACpD,YAAA,SAAS,EAAE,KAAK,CAAC,cAAc,CAAC,QAAQ;AACxC,YAAA,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,YAAY;SAC3C,CAAA;QACD,IAAI,CAAC,mBAAmB,EAAE;AACtB,YAAA,OAAO,MAAM,CAAC;AACjB,SAAA;QACD,IAAI,CAAC,mBAAmB,EAAE;YACtB,MAAM,CAAC,eAAe,GAAG,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;AAC9D,YAAA,OAAO,MAAM,CAAC;AACjB,SAAA;AACD,QAAA,MAAM,CAAC,eAAe,GAAG,mBAAmB,CAAC;QAC7C,MAAM,CAAC,SAAS,GAAG,OAAO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ent":["import { IOptionSet } from \"./interfaces\";\nimport { ITheme, Theme } from \"@fluentui/react\";\nimport { DeepPartial } from \"@talxis/client-libraries\";\nimport { Theming, useThemeGenerator } from \"@talxis/react-components\";\n\nexport const useComboBoxTheme = (props: IOptionSet, theme: ITheme): [boolean, ITheme] => {\n const boundValue = props.parameters.value;\n const { Options } = boundValue.attributes;\n const selectedOptionColor = boundValue.attributes.Options.find(x => x.Value === boundValue.raw)?.Color;\n\n const getColors = (colorFeatureEnabled: boolean) => {\n const colors = {\n backgroundColor: theme.semanticColors.bodyBackground,\n textColor: theme.semanticColors.bodyText,\n primaryColor: theme.palette.themePrimary\n }\n if (!colorFeatureEnabled) {\n return colors;\n }\n if (!selectedOptionColor) {\n colors.backgroundColor = theme.semanticColors.inputBackground;\n return colors;\n }\n colors.backgroundColor = selectedOptionColor;\n colors.textColor = Theming.GetTextColorForBackground(selectedOptionColor);\n return colors;\n }\n const getIsColorFeatureEnabled = () => {\n if (props.parameters.EnableOptionSetColors?.raw && Options.find(x => x.Color)) {\n return true;\n }\n return false;\n }\n\n /**\n * Since we are creating new theme for combobox, we need to add the overrides in cases where there is no color feature enabled or no color is selected.\n */\n const getThemeOverride = (colorFeatureEnabled: boolean): DeepPartial<Theme> => {\n const override: DeepPartial<ITheme> = {\n ...props.context.fluentDesignLanguage?.v8FluentOverrides\n }\n if(!colorFeatureEnabled) {\n return override;\n }\n if(!selectedOptionColor) {\n return override;\n }\n delete override.semanticColors?.inputBackground;\n return {\n fonts: {\n medium: {\n fontWeight: 600\n }\n },\n ...override,\n };\n }\n\n const isColorFeatureEnabled = getIsColorFeatureEnabled();\n const colors = getColors(isColorFeatureEnabled);\n const override = getThemeOverride(isColorFeatureEnabled);\n\n const currentTheme = useThemeGenerator(colors.primaryColor, colors.backgroundColor, colors.textColor, override)\n return [isColorFeatureEnabled, currentTheme];\n}"],"names":[],"mappings":";;MAKa,gBAAgB,GAAG,CAAC,KAAiB,EAAE,KAAa,KAAuB;AACpF,IAAA,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KAAwB;AAC1E,QAAA,MAAM,QAAQ,GAAwB;AAClC,YAAA,GAAG,KAAK,CAAC,OAAO,CAAC,oBAAoB,EAAE,iBAAiB;SAC3D,CAAA;QACD,IAAG,CAAC,mBAAmB,EAAE;AACrB,YAAA,OAAO,QAAQ,CAAC;AACnB,SAAA;QACD,IAAG,CAAC,mBAAmB,EAAE;AACrB,YAAA,OAAO,QAAQ,CAAC;AACnB,SAAA;AACD,QAAA,OAAO,QAAQ,CAAC,cAAc,EAAE,eAAe,CAAC;QAChD,OAAO;AACH,YAAA,KAAK,EAAE;AACH,gBAAA,MAAM,EAAE;AACJ,oBAAA,UAAU,EAAE,GAAG;AAClB,iBAAA;AACJ,aAAA;AACD,YAAA,GAAG,QAAQ;SACd,CAAC;AACN,KAAC,CAAA;AAED,IAAA,MAAM,qBAAqB,GAAG,wBAAwB,EAAE,CAAC;AACzD,IAAA,MAAM,MAAM,GAAG,SAAS,CAAC,qBAAqB,CAAC,CAAC;AAChD,IAAA,MAAM,QAAQ,GAAG,gBAAgB,CAAC,qBAAqB,CAAC,CAAC;AAEzD,IAAA,MAAM,YAAY,GAAG,iBAAiB,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAA;AAC/G,IAAA,OAAO,CAAC,qBAAqB,EAAE,YAAY,CAAC,CAAC;AACjD;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@talxis/base-controls",
3
- "version": "1.2505.7",
3
+ "version": "1.2505.8",
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",