@controleonline/ui-default 1.0.265 → 1.0.266

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,58 +1,52 @@
1
- import { useMemo } from 'react';
2
- import { useStore } from '@store';
3
- import { resolveThemePalette } from '@controleonline/../../src/styles/branding';
4
- import { colors } from '@controleonline/../../src/styles/colors';
5
-
6
- const useDefaultTableTheme = (accentColor = null) => {
7
- const themeStore = useStore('theme');
8
- const baseColors = themeStore?.getters?.colors || {};
9
- const themeTokens = useMemo(
10
- () => ({ ...baseColors }),
11
- [baseColors],
12
- );
13
- const palette = useMemo(
14
- () => resolveThemePalette(themeTokens, colors) || {},
15
- [themeTokens],
16
- );
17
- const themeColors = palette.colors || baseColors || colors || {};
18
- const resolvedAccentColor = accentColor || palette.primary || themeColors.primary || '#0EA5E9';
19
-
20
- return {
21
- palette,
22
- resolvedAccentColor,
23
- themeColors,
24
- themeTokens,
25
- checkboxBorderColor: themeColors.checkboxBorder,
26
- checkboxSelectedMarkColor: themeColors.checkboxSelectedMark,
27
- modalColors: {
28
- backgroundColor: themeColors.modalBackground,
29
- borderColor: themeColors.modalBorder,
30
- closeIconColor: themeColors.modalCloseIcon,
31
- headerTextColor: themeColors.modalHeaderText,
32
- overlayColor: themeColors.modalOverlay,
33
- textColor: themeColors.modalText,
34
- },
35
- tableButtonColors: {
36
- backgroundColor: themeColors.buttonBackground,
37
- borderColor: themeColors.buttonBorder,
38
- iconColor: themeColors.buttonIcon,
39
- pressedBackgroundColor: themeColors.buttonPressedBackground,
40
- pressedBorderColor: themeColors.buttonPressedBorder,
41
- pressedIconColor: themeColors.buttonPressedIcon,
42
- textColor: themeColors.buttonText,
43
- },
44
- tableActionColors: {
45
- backgroundColor: themeColors.tableActionBackground,
46
- borderColor: themeColors.tableActionBorder,
47
- textColor: themeColors.tableActionIcon,
48
- },
49
- toolbarColors: {
50
- backgroundColor: themeColors.toolbarBackground,
51
- borderColor: themeColors.toolbarBorder,
52
- countBackgroundColor: themeColors.badgeBackground,
53
- countTextColor: themeColors.badgeText,
54
- },
55
- };
56
- };
57
-
58
- export default useDefaultTableTheme;
1
+ import { useMemo } from 'react';
2
+ import { useStore } from '@store';
3
+
4
+ const useDefaultTableTheme = (accentColor = null) => {
5
+ const themeStore = useStore('theme');
6
+ const themeColors = themeStore.getters.colors;
7
+ const themeTokens = useMemo(
8
+ () => ({ ...themeColors }),
9
+ [themeColors],
10
+ );
11
+ const palette = themeColors;
12
+ const resolvedAccentColor = accentColor ?? themeColors.primary;
13
+
14
+ return {
15
+ palette,
16
+ resolvedAccentColor,
17
+ themeColors,
18
+ themeTokens,
19
+ checkboxBorderColor: themeColors.checkboxBorder,
20
+ checkboxSelectedMarkColor: themeColors.checkboxSelectedMark,
21
+ modalColors: {
22
+ backgroundColor: themeColors.modalBackground,
23
+ borderColor: themeColors.modalBorder,
24
+ closeIconColor: themeColors.modalCloseIcon,
25
+ headerTextColor: themeColors.modalHeaderText,
26
+ overlayColor: themeColors.modalOverlay,
27
+ textColor: themeColors.modalText,
28
+ },
29
+ tableButtonColors: {
30
+ backgroundColor: themeColors.buttonBackground,
31
+ borderColor: themeColors.buttonBorder,
32
+ iconColor: themeColors.buttonIcon,
33
+ pressedBackgroundColor: themeColors.buttonPressedBackground,
34
+ pressedBorderColor: themeColors.buttonPressedBorder,
35
+ pressedIconColor: themeColors.buttonPressedIcon,
36
+ textColor: themeColors.buttonText,
37
+ },
38
+ tableActionColors: {
39
+ backgroundColor: themeColors.tableActionBackground,
40
+ borderColor: themeColors.tableActionBorder,
41
+ textColor: themeColors.tableActionIcon,
42
+ },
43
+ toolbarColors: {
44
+ backgroundColor: themeColors.toolbarBackground,
45
+ borderColor: themeColors.toolbarBorder,
46
+ countBackgroundColor: themeColors.badgeBackground,
47
+ countTextColor: themeColors.badgeText,
48
+ },
49
+ };
50
+ };
51
+
52
+ export default useDefaultTableTheme;