terrier-engine 4.39.0 → 4.39.2

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/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "files": [
5
5
  "*"
6
6
  ],
7
- "version": "4.39.0",
7
+ "version": "4.39.2",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "https://github.com/Terrier-Tech/terrier-engine"
@@ -123,7 +123,7 @@ function panelActions(panel: PartTag, actions: PanelActions, theme: Theme) {
123
123
  const levelActions = actions[level]
124
124
  if (!levelActions?.length) continue;
125
125
  actionsContainer.div(`.${level}-actions`, container => {
126
- theme.renderActions(container, levelActions, { iconColor: 'white', defaultClass: level })
126
+ theme.renderActions(container, levelActions, { defaultClass: level })
127
127
  })
128
128
  }
129
129
  })
package/terrier/theme.ts CHANGED
@@ -35,6 +35,7 @@ export type Action = {
35
35
  subtitle?: string
36
36
  tooltip?: string
37
37
  icon?: IconName
38
+ color?: ColorName
38
39
  img?: string
39
40
  href?: string
40
41
  classes?: string[]
@@ -90,7 +91,7 @@ export default class Theme {
90
91
  actions = [actions]
91
92
  }
92
93
  for (const action of actions) {
93
- let iconColor = options?.iconColor
94
+ let iconColor = action.color || options?.iconColor
94
95
  const attrs = action.tooltip?.length ? {data: {tooltip: action.tooltip}} : {}
95
96
  parent.a(attrs, a => {
96
97
  const classes = action.classes || []
@@ -111,6 +112,9 @@ export default class Theme {
111
112
  if (action.subtitle?.length) {
112
113
  a.div('.subtitle', {text: action.subtitle})
113
114
  }
115
+ if (iconColor?.length) {
116
+ a.class(iconColor)
117
+ }
114
118
  if (!(action.title?.length || action.subtitle?.length)) {
115
119
  a.class('icon-only')
116
120
  }