@budibase/bbui 3.0.0 → 3.0.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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@budibase/bbui",
3
3
  "description": "A UI solution used in the different Budibase projects.",
4
- "version": "3.0.0",
4
+ "version": "3.0.2",
5
5
  "license": "MPL-2.0",
6
6
  "svelte": "src/index.js",
7
7
  "module": "dist/bbui.es.js",
@@ -35,8 +35,8 @@
35
35
  ],
36
36
  "dependencies": {
37
37
  "@adobe/spectrum-css-workflow-icons": "1.2.1",
38
- "@budibase/shared-core": "3.0.0",
39
- "@budibase/string-templates": "3.0.0",
38
+ "@budibase/shared-core": "3.0.2",
39
+ "@budibase/string-templates": "3.0.2",
40
40
  "@spectrum-css/accordion": "3.0.24",
41
41
  "@spectrum-css/actionbutton": "1.0.1",
42
42
  "@spectrum-css/actiongroup": "1.0.1",
@@ -104,5 +104,5 @@
104
104
  }
105
105
  }
106
106
  },
107
- "gitHead": "1272ac91c894cc5036dd188e969c77f33ed41ced"
107
+ "gitHead": "94ce7a86f28cdd215d6695b5add3c99829979a37"
108
108
  }
@@ -6,6 +6,11 @@
6
6
  import Icon from "../Icon/Icon.svelte"
7
7
  import Input from "../Form/Input.svelte"
8
8
  import { capitalise } from "../helpers"
9
+ import {
10
+ ensureValidTheme,
11
+ getThemeClassNames,
12
+ DefaultAppTheme,
13
+ } from "@budibase/shared-core"
9
14
 
10
15
  export let value
11
16
  export let size = "M"
@@ -18,6 +23,7 @@
18
23
 
19
24
  $: customValue = getCustomValue(value)
20
25
  $: checkColor = getCheckColor(value)
26
+ $: themeClasses = getThemeClasses(spectrumTheme)
21
27
 
22
28
  const dispatch = createEventDispatcher()
23
29
  const categories = [
@@ -91,6 +97,14 @@
91
97
  },
92
98
  ]
93
99
 
100
+ const getThemeClasses = theme => {
101
+ if (!theme) {
102
+ return ""
103
+ }
104
+ theme = ensureValidTheme(theme, DefaultAppTheme)
105
+ return getThemeClassNames(theme)
106
+ }
107
+
94
108
  const onChange = value => {
95
109
  dispatch("change", value)
96
110
  dropdown.hide()
@@ -147,7 +161,7 @@
147
161
  }}
148
162
  >
149
163
  <div
150
- class="fill {spectrumTheme || ''}"
164
+ class="fill {themeClasses}"
151
165
  style={value ? `background: ${value};` : ""}
152
166
  class:placeholder={!value}
153
167
  />
@@ -171,7 +185,7 @@
171
185
  title={prettyPrint(color)}
172
186
  >
173
187
  <div
174
- class="fill {spectrumTheme || ''}"
188
+ class="fill {themeClasses}"
175
189
  style="background: var(--spectrum-global-color-{color}); color: {checkColor};"
176
190
  >
177
191
  {#if value === `var(--spectrum-global-color-${color})`}