@budibase/bbui 1.4.17 → 1.4.18
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/dist/bbui.es.js +3 -3
- package/dist/bbui.es.js.map +1 -1
- package/package.json +3 -3
- package/src/Form/Core/PickerDropdown.svelte +14 -35
- package/src/Form/PickerDropdown.svelte +0 -2
- package/src/Icon/IconAvatar.svelte +58 -0
- package/src/List/ListItem.svelte +3 -11
- package/src/Modal/ModalContent.svelte +1 -1
- package/src/Popover/Popover.svelte +1 -0
- package/src/index.js +1 -0
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": "1.4.
|
|
4
|
+
"version": "1.4.18",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"svelte": "src/index.js",
|
|
7
7
|
"module": "dist/bbui.es.js",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@adobe/spectrum-css-workflow-icons": "^1.2.1",
|
|
41
|
-
"@budibase/string-templates": "^1.4.
|
|
41
|
+
"@budibase/string-templates": "^1.4.18",
|
|
42
42
|
"@spectrum-css/actionbutton": "^1.0.1",
|
|
43
43
|
"@spectrum-css/actiongroup": "^1.0.1",
|
|
44
44
|
"@spectrum-css/avatar": "^3.0.2",
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
"svelte-flatpickr": "^3.2.3",
|
|
86
86
|
"svelte-portal": "^1.0.0"
|
|
87
87
|
},
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "395b2a45e083fb38f6ee4d3ed2b4d71534d6f526"
|
|
89
89
|
}
|
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
import StatusLight from "../../StatusLight/StatusLight.svelte"
|
|
10
10
|
import Detail from "../../Typography/Detail.svelte"
|
|
11
11
|
import Search from "./Search.svelte"
|
|
12
|
+
import IconAvatar from "../../Icon/IconAvatar.svelte"
|
|
12
13
|
|
|
13
14
|
export let primaryLabel = ""
|
|
14
15
|
export let primaryValue = null
|
|
15
16
|
export let id = null
|
|
16
17
|
export let placeholder = "Choose an option or type"
|
|
17
18
|
export let disabled = false
|
|
18
|
-
export let updateOnChange = true
|
|
19
19
|
export let error = null
|
|
20
20
|
export let secondaryOptions = []
|
|
21
21
|
export let primaryOptions = []
|
|
@@ -204,19 +204,11 @@
|
|
|
204
204
|
})}
|
|
205
205
|
>
|
|
206
206
|
{#if primaryOptions[title].getIcon(option)}
|
|
207
|
-
<
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
)}
|
|
211
|
-
|
|
212
|
-
>
|
|
213
|
-
<div>
|
|
214
|
-
<Icon
|
|
215
|
-
size="S"
|
|
216
|
-
name={primaryOptions[title].getIcon(option)}
|
|
217
|
-
/>
|
|
218
|
-
</div>
|
|
219
|
-
</div>
|
|
207
|
+
<IconAvatar
|
|
208
|
+
size="S"
|
|
209
|
+
icon={primaryOptions[title].getIcon(option)}
|
|
210
|
+
background={primaryOptions[title].getColour(option)}
|
|
211
|
+
/>
|
|
220
212
|
{:else if getPrimaryOptionColour(option, idx)}
|
|
221
213
|
<span class="option-left">
|
|
222
214
|
<StatusLight
|
|
@@ -226,12 +218,13 @@
|
|
|
226
218
|
</span>
|
|
227
219
|
{/if}
|
|
228
220
|
<span class="spectrum-Menu-itemLabel">
|
|
229
|
-
<
|
|
221
|
+
<div
|
|
222
|
+
class="primary-text"
|
|
230
223
|
class:spacing-group={primaryOptions[title].getIcon(option)}
|
|
231
224
|
>
|
|
232
225
|
{primaryOptions[title].getLabel(option)}
|
|
233
226
|
<span />
|
|
234
|
-
</
|
|
227
|
+
</div>
|
|
235
228
|
<svg
|
|
236
229
|
class="spectrum-Icon spectrum-UIIcon-Checkmark100 spectrum-Menu-checkmark spectrum-Menu-itemIcon"
|
|
237
230
|
focusable="false"
|
|
@@ -335,6 +328,11 @@
|
|
|
335
328
|
</div>
|
|
336
329
|
|
|
337
330
|
<style>
|
|
331
|
+
.primary-text {
|
|
332
|
+
white-space: nowrap;
|
|
333
|
+
overflow: hidden;
|
|
334
|
+
text-overflow: ellipsis;
|
|
335
|
+
}
|
|
338
336
|
.spacing-group {
|
|
339
337
|
margin-left: var(--spacing-m);
|
|
340
338
|
}
|
|
@@ -367,25 +365,6 @@
|
|
|
367
365
|
padding-left: 8px;
|
|
368
366
|
}
|
|
369
367
|
|
|
370
|
-
.circle {
|
|
371
|
-
border-radius: 50%;
|
|
372
|
-
height: 28px;
|
|
373
|
-
color: white;
|
|
374
|
-
font-weight: bold;
|
|
375
|
-
line-height: 48px;
|
|
376
|
-
font-size: 1.2em;
|
|
377
|
-
width: 28px;
|
|
378
|
-
position: relative;
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
.circle > div {
|
|
382
|
-
position: absolute;
|
|
383
|
-
text-decoration: none;
|
|
384
|
-
top: 50%;
|
|
385
|
-
left: 50%;
|
|
386
|
-
transform: translateX(-50%) translateY(-50%);
|
|
387
|
-
}
|
|
388
|
-
|
|
389
368
|
.iconPadding {
|
|
390
369
|
position: absolute;
|
|
391
370
|
top: 50%;
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
export let disabled = false
|
|
15
15
|
export let readonly = false
|
|
16
16
|
export let error = null
|
|
17
|
-
export let updateOnChange = true
|
|
18
17
|
export let getSecondaryOptionLabel = option =>
|
|
19
18
|
extractProperty(option, "label")
|
|
20
19
|
export let getSecondaryOptionValue = option =>
|
|
@@ -100,7 +99,6 @@
|
|
|
100
99
|
{searchTerm}
|
|
101
100
|
{autocomplete}
|
|
102
101
|
{dataCy}
|
|
103
|
-
{updateOnChange}
|
|
104
102
|
{error}
|
|
105
103
|
{disabled}
|
|
106
104
|
{readonly}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import Icon from "./Icon.svelte"
|
|
3
|
+
|
|
4
|
+
export let icon
|
|
5
|
+
export let background
|
|
6
|
+
export let color
|
|
7
|
+
export let size = "M"
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<div
|
|
11
|
+
class="icon size--{size}"
|
|
12
|
+
style="background: {background || `transparent`};"
|
|
13
|
+
class:filled={!!background}
|
|
14
|
+
>
|
|
15
|
+
<Icon name={icon} color={background ? "white" : color} />
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<style>
|
|
19
|
+
.icon {
|
|
20
|
+
width: 28px;
|
|
21
|
+
height: 28px;
|
|
22
|
+
display: grid;
|
|
23
|
+
place-items: center;
|
|
24
|
+
border-radius: 50%;
|
|
25
|
+
}
|
|
26
|
+
.icon :global(.spectrum-Icon) {
|
|
27
|
+
width: 22px;
|
|
28
|
+
height: 22px;
|
|
29
|
+
}
|
|
30
|
+
.icon.filled :global(.spectrum-Icon) {
|
|
31
|
+
width: 16px;
|
|
32
|
+
height: 16px;
|
|
33
|
+
}
|
|
34
|
+
.icon.size--S {
|
|
35
|
+
width: 22px;
|
|
36
|
+
height: 22px;
|
|
37
|
+
}
|
|
38
|
+
.icon.size--S :global(.spectrum-Icon) {
|
|
39
|
+
width: 16px;
|
|
40
|
+
height: 16px;
|
|
41
|
+
}
|
|
42
|
+
.icon.size--S.filled :global(.spectrum-Icon) {
|
|
43
|
+
width: 12px;
|
|
44
|
+
height: 12px;
|
|
45
|
+
}
|
|
46
|
+
.icon.size--L {
|
|
47
|
+
width: 40px;
|
|
48
|
+
height: 40px;
|
|
49
|
+
}
|
|
50
|
+
.icon.size--L :global(.spectrum-Icon) {
|
|
51
|
+
width: 28px;
|
|
52
|
+
height: 28px;
|
|
53
|
+
}
|
|
54
|
+
.icon.size--L.filled :global(.spectrum-Icon) {
|
|
55
|
+
width: 22px;
|
|
56
|
+
height: 22px;
|
|
57
|
+
}
|
|
58
|
+
</style>
|
package/src/List/ListItem.svelte
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import Body from "../Typography/Body.svelte"
|
|
3
|
-
import
|
|
3
|
+
import IconAvatar from "../Icon/IconAvatar.svelte"
|
|
4
4
|
import Label from "../Label/Label.svelte"
|
|
5
5
|
import Avatar from "../Avatar/Avatar.svelte"
|
|
6
6
|
|
|
7
7
|
export let icon = null
|
|
8
8
|
export let iconBackground = null
|
|
9
|
+
export let iconColor = null
|
|
9
10
|
export let avatar = false
|
|
10
11
|
export let title = null
|
|
11
12
|
export let subtitle = null
|
|
@@ -17,9 +18,7 @@
|
|
|
17
18
|
<div class="list-item" class:hoverable on:click>
|
|
18
19
|
<div class="left">
|
|
19
20
|
{#if icon}
|
|
20
|
-
<
|
|
21
|
-
<Icon name={icon} size="S" color={iconBackground ? "white" : null} />
|
|
22
|
-
</div>
|
|
21
|
+
<IconAvatar {icon} color={iconColor} background={iconBackground} />
|
|
23
22
|
{/if}
|
|
24
23
|
{#if avatar}
|
|
25
24
|
<Avatar {initials} />
|
|
@@ -88,11 +87,4 @@
|
|
|
88
87
|
overflow: hidden;
|
|
89
88
|
text-overflow: ellipsis;
|
|
90
89
|
}
|
|
91
|
-
.icon {
|
|
92
|
-
width: var(--spectrum-alias-avatar-size-400);
|
|
93
|
-
height: var(--spectrum-alias-avatar-size-400);
|
|
94
|
-
display: grid;
|
|
95
|
-
place-items: center;
|
|
96
|
-
border-radius: 50%;
|
|
97
|
-
}
|
|
98
90
|
</style>
|
package/src/index.js
CHANGED
|
@@ -20,6 +20,7 @@ export { default as Button } from "./Button/Button.svelte"
|
|
|
20
20
|
export { default as ButtonGroup } from "./ButtonGroup/ButtonGroup.svelte"
|
|
21
21
|
export { default as ClearButton } from "./ClearButton/ClearButton.svelte"
|
|
22
22
|
export { default as Icon, directions } from "./Icon/Icon.svelte"
|
|
23
|
+
export { default as IconAvatar } from "./Icon/IconAvatar.svelte"
|
|
23
24
|
export { default as Toggle } from "./Form/Toggle.svelte"
|
|
24
25
|
export { default as RadioGroup } from "./Form/RadioGroup.svelte"
|
|
25
26
|
export { default as Checkbox } from "./Form/Checkbox.svelte"
|