@onehat/ui 0.2.73 → 0.2.75

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.
@@ -63,9 +63,6 @@ const defaults = {
63
63
  GRID_ROW_HOVER_BG: 'hover',
64
64
  GRID_ROW_SELECTED_BG: 'selected',
65
65
  GRID_ROW_SELECTED_HOVER_BG: 'selectedHover',
66
- GRID_TOOLBAR_ITEMS_COLOR: 'trueGray.800',
67
- GRID_TOOLBAR_ITEMS_DISABLED_COLOR: 'disabled',
68
- GRID_TOOLBAR_ITEMS_ICON_SIZE: 'sm',
69
66
  ICON_BUTTON_BG: 'trueGray.200:alpha.0',
70
67
  ICON_BUTTON_BG_DISABLED: 'trueGray.200',
71
68
  ICON_BUTTON_BG_HOVER: '#000:alpha.20',
@@ -97,9 +94,9 @@ const defaults = {
97
94
  TREE_NODE_HOVER_BG: 'hover',
98
95
  TREE_NODE_SELECTED_BG: 'selected',
99
96
  TREE_NODE_SELECTED_HOVER_BG: 'selectedHover',
100
- TREE_TOOLBAR_ITEMS_COLOR: 'trueGray.800',
101
- TREE_TOOLBAR_ITEMS_DISABLED_COLOR: 'disabled',
102
- TREE_TOOLBAR_ITEMS_ICON_SIZE: 'sm',
97
+ TOOLBAR_ITEMS_COLOR: 'trueGray.800',
98
+ TOOLBAR_ITEMS_DISABLED_COLOR: 'trueGray.400',
99
+ TOOLBAR_ITEMS_ICON_SIZE: 'sm',
103
100
  VIEWER_ANCILLARY_FONTSIZE: 22,
104
101
  };
105
102
 
@@ -0,0 +1,37 @@
1
+ import IconButton from '../Components/Buttons/IconButton.js';
2
+ import UiGlobals from '../UiGlobals.js';
3
+
4
+ export default function getIconButtonFromConfig(config, ix) {
5
+ const
6
+ {
7
+ key,
8
+ text,
9
+ handler,
10
+ icon = null,
11
+ isDisabled = false,
12
+ } = config,
13
+ styles = UiGlobals.styles,
14
+ iconButtonProps = {
15
+ _hover: {
16
+ bg: 'trueGray.400',
17
+ },
18
+ mx: 1,
19
+ px: 3,
20
+ },
21
+ _icon = {
22
+ alignSelf: 'center',
23
+ size: styles.TOOLBAR_ITEMS_ICON_SIZE,
24
+ h: 20,
25
+ w: 20,
26
+ color: isDisabled ? styles.TOOLBAR_ITEMS_DISABLED_COLOR : styles.TOOLBAR_ITEMS_COLOR,
27
+ };
28
+ return <IconButton
29
+ key={key || ix}
30
+ onPress={handler}
31
+ icon={icon}
32
+ _icon={_icon}
33
+ isDisabled={isDisabled}
34
+ tooltip={text}
35
+ {...iconButtonProps}
36
+ />;
37
+ }