@budibase/bbui 2.6.19-alpha.3 → 2.6.19-alpha.31
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": "2.6.19-alpha.
|
|
4
|
+
"version": "2.6.19-alpha.31",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"svelte": "src/index.js",
|
|
7
7
|
"module": "dist/bbui.es.js",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@adobe/spectrum-css-workflow-icons": "1.2.1",
|
|
41
|
-
"@budibase/shared-core": "2.6.19-alpha.
|
|
42
|
-
"@budibase/string-templates": "2.6.19-alpha.
|
|
41
|
+
"@budibase/shared-core": "2.6.19-alpha.31",
|
|
42
|
+
"@budibase/string-templates": "2.6.19-alpha.31",
|
|
43
43
|
"@spectrum-css/accordion": "3.0.24",
|
|
44
44
|
"@spectrum-css/actionbutton": "1.0.1",
|
|
45
45
|
"@spectrum-css/actiongroup": "1.0.1",
|
|
@@ -90,5 +90,19 @@
|
|
|
90
90
|
"resolutions": {
|
|
91
91
|
"loader-utils": "1.4.1"
|
|
92
92
|
},
|
|
93
|
-
"
|
|
93
|
+
"nx": {
|
|
94
|
+
"targets": {
|
|
95
|
+
"build": {
|
|
96
|
+
"dependsOn": [
|
|
97
|
+
{
|
|
98
|
+
"projects": [
|
|
99
|
+
"@budibase/string-templates"
|
|
100
|
+
],
|
|
101
|
+
"target": "build"
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"gitHead": "46abe5917ecc3ed921f10dfd9aff09f1970f80c3"
|
|
94
108
|
}
|
|
@@ -102,7 +102,9 @@
|
|
|
102
102
|
margin-left: 0;
|
|
103
103
|
transition: color ease-out 130ms;
|
|
104
104
|
}
|
|
105
|
-
.is-selected:not(.spectrum-ActionButton--emphasized):not(
|
|
105
|
+
.is-selected:not(.spectrum-ActionButton--emphasized):not(
|
|
106
|
+
.spectrum-ActionButton--quiet
|
|
107
|
+
) {
|
|
106
108
|
background: var(--spectrum-global-color-gray-300);
|
|
107
109
|
border-color: var(--spectrum-global-color-gray-500);
|
|
108
110
|
}
|
package/src/Avatar/Avatar.svelte
CHANGED
|
@@ -13,10 +13,12 @@
|
|
|
13
13
|
export let url = ""
|
|
14
14
|
export let disabled = false
|
|
15
15
|
export let initials = "JD"
|
|
16
|
+
export let color = null
|
|
16
17
|
|
|
17
18
|
const DefaultColor = "#3aab87"
|
|
18
19
|
|
|
19
|
-
$:
|
|
20
|
+
$: avatarColor = color || getColor(initials)
|
|
21
|
+
$: style = getStyle(size, avatarColor)
|
|
20
22
|
|
|
21
23
|
const getColor = initials => {
|
|
22
24
|
if (!initials?.length) {
|
|
@@ -26,6 +28,12 @@
|
|
|
26
28
|
const hue = ((code % 26) / 26) * 360
|
|
27
29
|
return `hsl(${hue}, 50%, 50%)`
|
|
28
30
|
}
|
|
31
|
+
|
|
32
|
+
const getStyle = (sizeKey, color) => {
|
|
33
|
+
const size = `var(${sizes.get(sizeKey)})`
|
|
34
|
+
const fontSize = `calc(${size} / 2)`
|
|
35
|
+
return `width:${size}; height:${size}; font-size:${fontSize}; background:${color};`
|
|
36
|
+
}
|
|
29
37
|
</script>
|
|
30
38
|
|
|
31
39
|
{#if url}
|
|
@@ -37,13 +45,7 @@
|
|
|
37
45
|
style="width: var({sizes.get(size)}); height: var({sizes.get(size)});"
|
|
38
46
|
/>
|
|
39
47
|
{:else}
|
|
40
|
-
<div
|
|
41
|
-
class="spectrum-Avatar"
|
|
42
|
-
class:is-disabled={disabled}
|
|
43
|
-
style="width: var({sizes.get(size)}); height: var({sizes.get(
|
|
44
|
-
size
|
|
45
|
-
)}); font-size: calc(var({sizes.get(size)}) / 2); background: {color};"
|
|
46
|
-
>
|
|
48
|
+
<div class="spectrum-Avatar" class:is-disabled={disabled} {style}>
|
|
47
49
|
{initials || ""}
|
|
48
50
|
</div>
|
|
49
51
|
{/if}
|