@budibase/bbui 3.11.2 → 3.12.0
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.mjs +3302 -3295
- package/package.json +2 -2
- package/src/ActionButton/ActionButton.svelte +5 -2
- package/src/Button/Button.svelte +8 -2
- package/src/ButtonGroup/ButtonGroup.svelte +4 -4
- package/src/ColorPicker/ColorPicker.svelte +5 -2
- package/src/Drawer/Drawer.svelte +6 -2
- package/src/FancyForm/FancyField.svelte +3 -1
- package/src/FancyForm/FancyFieldLabel.svelte +3 -1
- package/src/FancyForm/FancyInput.svelte +3 -1
- package/src/FancyForm/FancySelect.svelte +6 -2
- package/src/Form/Core/TextField.svelte +1 -0
- package/src/Input/CopyInput.svelte +2 -2
- package/src/List/ListItem.svelte +6 -2
- package/src/Modal/CustomContent.svelte +1 -1
- package/src/Modal/Modal.svelte +20 -8
- package/src/Modal/ModalContent.svelte +8 -6
- package/src/Table/DateTimeRenderer.svelte +2 -2
- package/src/Tooltip/AbsTooltip.svelte +3 -1
- package/src/bbui.css +10 -2
- package/src/constants.ts +7 -0
- package/src/types/modalContext.ts +3 -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": "3.
|
|
4
|
+
"version": "3.12.0",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"svelte": "src/index.ts",
|
|
7
7
|
"module": "dist/bbui.mjs",
|
|
@@ -99,5 +99,5 @@
|
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
},
|
|
102
|
-
"gitHead": "
|
|
102
|
+
"gitHead": "4d3f7719ab1ae02d3d01908b8a14a31a0c81445d"
|
|
103
103
|
}
|
|
@@ -68,8 +68,11 @@
|
|
|
68
68
|
|
|
69
69
|
<style>
|
|
70
70
|
button {
|
|
71
|
-
transition:
|
|
72
|
-
|
|
71
|
+
transition:
|
|
72
|
+
filter 130ms ease-out,
|
|
73
|
+
background 130ms ease-out,
|
|
74
|
+
border 130ms ease-out,
|
|
75
|
+
color 130ms ease-out;
|
|
73
76
|
}
|
|
74
77
|
.fullWidth {
|
|
75
78
|
width: 100%;
|
package/src/Button/Button.svelte
CHANGED
|
@@ -70,6 +70,9 @@
|
|
|
70
70
|
button.is-disabled {
|
|
71
71
|
cursor: default;
|
|
72
72
|
}
|
|
73
|
+
.spectrum-Button {
|
|
74
|
+
padding-bottom: calc(var(--spectrum-button-padding-y) - 1px);
|
|
75
|
+
}
|
|
73
76
|
.spectrum-Button-label {
|
|
74
77
|
white-space: nowrap;
|
|
75
78
|
overflow: hidden;
|
|
@@ -100,8 +103,11 @@
|
|
|
100
103
|
.spectrum-Button .spectrum-Button-label + .spectrum-Icon {
|
|
101
104
|
margin-left: var(--spectrum-button-primary-icon-gap);
|
|
102
105
|
margin-right: calc(
|
|
103
|
-
-1 *
|
|
104
|
-
|
|
106
|
+
-1 *
|
|
107
|
+
(
|
|
108
|
+
var(--spectrum-button-primary-textonly-padding-left-adjusted) -
|
|
109
|
+
var(--spectrum-button-primary-padding-left-adjusted)
|
|
110
|
+
)
|
|
105
111
|
);
|
|
106
112
|
}
|
|
107
113
|
</style>
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
gap === "L"
|
|
9
9
|
? "var(--spacing-l)"
|
|
10
10
|
: gap === "M"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
? "var(--spacing-m)"
|
|
12
|
+
: gap === "S"
|
|
13
|
+
? "var(--spacing-s)"
|
|
14
|
+
: null
|
|
15
15
|
|
|
16
16
|
function group(element) {
|
|
17
17
|
const buttons = Array.from(element.getElementsByTagName("button"))
|
|
@@ -278,9 +278,12 @@
|
|
|
278
278
|
place-items: center;
|
|
279
279
|
}
|
|
280
280
|
.fill.placeholder {
|
|
281
|
-
background-position:
|
|
281
|
+
background-position:
|
|
282
|
+
0 0,
|
|
283
|
+
10px 10px;
|
|
282
284
|
background-size: 20px 20px;
|
|
283
|
-
background-image:
|
|
285
|
+
background-image:
|
|
286
|
+
linear-gradient(
|
|
284
287
|
45deg,
|
|
285
288
|
#eee 25%,
|
|
286
289
|
transparent 25%,
|
package/src/Drawer/Drawer.svelte
CHANGED
|
@@ -227,8 +227,12 @@
|
|
|
227
227
|
border-radius: 8px;
|
|
228
228
|
overflow: hidden;
|
|
229
229
|
box-sizing: border-box;
|
|
230
|
-
transition:
|
|
231
|
-
|
|
230
|
+
transition:
|
|
231
|
+
transform 260ms ease-out,
|
|
232
|
+
bottom 260ms ease-out,
|
|
233
|
+
left 260ms ease-out,
|
|
234
|
+
width 260ms ease-out,
|
|
235
|
+
height 260ms ease-out;
|
|
232
236
|
display: flex;
|
|
233
237
|
flex-direction: column;
|
|
234
238
|
align-items: stretch;
|
|
@@ -69,7 +69,9 @@
|
|
|
69
69
|
border: 1px solid var(--spectrum-global-color-gray-300);
|
|
70
70
|
border-radius: 4px;
|
|
71
71
|
box-sizing: border-box;
|
|
72
|
-
transition:
|
|
72
|
+
transition:
|
|
73
|
+
border-color 130ms ease-out,
|
|
74
|
+
background 130ms ease-out,
|
|
73
75
|
background 130ms ease-out;
|
|
74
76
|
color: var(--spectrum-global-color-gray-800);
|
|
75
77
|
--padding: 16px;
|
|
@@ -14,7 +14,9 @@
|
|
|
14
14
|
position: absolute;
|
|
15
15
|
top: 10px;
|
|
16
16
|
color: var(--spectrum-global-color-gray-600);
|
|
17
|
-
transition:
|
|
17
|
+
transition:
|
|
18
|
+
font-size 130ms ease-out,
|
|
19
|
+
top 130ms ease-out,
|
|
18
20
|
transform 130ms ease-out;
|
|
19
21
|
}
|
|
20
22
|
div.placeholder {
|
|
@@ -113,7 +113,9 @@
|
|
|
113
113
|
border-radius: 2px;
|
|
114
114
|
-webkit-box-shadow: 0 0 0 100px var(--spectrum-global-color-gray-300) inset;
|
|
115
115
|
-webkit-text-fill-color: var(--spectrum-global-color-gray-900);
|
|
116
|
-
transition:
|
|
116
|
+
transition:
|
|
117
|
+
-webkit-box-shadow 130ms 200ms,
|
|
118
|
+
background-color 0s 86400s;
|
|
117
119
|
padding: 3px 8px 4px 8px;
|
|
118
120
|
}
|
|
119
121
|
</style>
|
|
@@ -125,7 +125,9 @@
|
|
|
125
125
|
font-size: 15px;
|
|
126
126
|
line-height: 17px;
|
|
127
127
|
color: var(--spectrum-global-color-gray-900);
|
|
128
|
-
transition:
|
|
128
|
+
transition:
|
|
129
|
+
transform 130ms ease-out,
|
|
130
|
+
opacity 130ms ease-out;
|
|
129
131
|
opacity: 1;
|
|
130
132
|
white-space: nowrap;
|
|
131
133
|
text-overflow: ellipsis;
|
|
@@ -139,7 +141,9 @@
|
|
|
139
141
|
font-size: 15px;
|
|
140
142
|
line-height: 17px;
|
|
141
143
|
color: var(--spectrum-global-color-gray-900);
|
|
142
|
-
transition:
|
|
144
|
+
transition:
|
|
145
|
+
transform 130ms ease-out,
|
|
146
|
+
opacity 130ms ease-out;
|
|
143
147
|
transform: translateY(9px);
|
|
144
148
|
}
|
|
145
149
|
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
width: 31px;
|
|
49
49
|
color: var(--spectrum-alias-text-color);
|
|
50
50
|
background-color: var(--spectrum-global-color-gray-75);
|
|
51
|
-
transition:
|
|
52
|
-
|
|
51
|
+
transition:
|
|
52
|
+
background-color var(--spectrum-global-animation-duration-100, 130ms),
|
|
53
53
|
box-shadow var(--spectrum-global-animation-duration-100, 130ms),
|
|
54
54
|
border-color var(--spectrum-global-animation-duration-100, 130ms);
|
|
55
55
|
height: calc(var(--spectrum-alias-item-height-m) - 2px);
|
package/src/List/ListItem.svelte
CHANGED
|
@@ -57,7 +57,9 @@
|
|
|
57
57
|
flex-direction: row;
|
|
58
58
|
justify-content: space-between;
|
|
59
59
|
border: 1px solid var(--spectrum-global-color-gray-300);
|
|
60
|
-
transition:
|
|
60
|
+
transition:
|
|
61
|
+
background 130ms ease-out,
|
|
62
|
+
border-color 130ms ease-out;
|
|
61
63
|
gap: var(--spacing-m);
|
|
62
64
|
color: var(--spectrum-global-color-gray-800);
|
|
63
65
|
cursor: pointer;
|
|
@@ -112,7 +114,9 @@
|
|
|
112
114
|
padding: 4px;
|
|
113
115
|
border-radius: 4px;
|
|
114
116
|
border: 1px solid var(--spectrum-global-color-gray-300);
|
|
115
|
-
transition:
|
|
117
|
+
transition:
|
|
118
|
+
background-color 130ms ease-out,
|
|
119
|
+
border-color 130ms ease-out,
|
|
116
120
|
color 130ms ease-out;
|
|
117
121
|
}
|
|
118
122
|
.list-item.large.hoverable:not(.selected):hover .list-item__icon {
|
package/src/Modal/Modal.svelte
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { fade, fly } from "svelte/transition"
|
|
6
6
|
import Portal from "svelte-portal"
|
|
7
7
|
import Context from "../context"
|
|
8
|
+
import { ModalCancelFrom } from "../constants"
|
|
8
9
|
|
|
9
10
|
export let fixed: boolean = false
|
|
10
11
|
export let inline: boolean = false
|
|
@@ -15,7 +16,7 @@
|
|
|
15
16
|
const dispatch = createEventDispatcher<{
|
|
16
17
|
show: void
|
|
17
18
|
hide: void
|
|
18
|
-
cancel:
|
|
19
|
+
cancel: ModalCancelFrom
|
|
19
20
|
}>()
|
|
20
21
|
let visible: boolean = fixed || inline
|
|
21
22
|
let modal: HTMLElement | undefined
|
|
@@ -44,17 +45,17 @@
|
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
|
|
47
|
-
export function cancel(): void {
|
|
48
|
+
export function cancel(from: ModalCancelFrom): void {
|
|
48
49
|
if (!visible || disableCancel) {
|
|
49
50
|
return
|
|
50
51
|
}
|
|
51
|
-
dispatch("cancel")
|
|
52
|
+
dispatch("cancel", from)
|
|
52
53
|
hide()
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
function handleKey(e: KeyboardEvent): void {
|
|
56
57
|
if (visible && e.key === "Escape") {
|
|
57
|
-
cancel()
|
|
58
|
+
cancel(ModalCancelFrom.ESCAPE_KEY)
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
61
|
|
|
@@ -78,7 +79,12 @@
|
|
|
78
79
|
hide,
|
|
79
80
|
toggle,
|
|
80
81
|
cancel,
|
|
81
|
-
} as {
|
|
82
|
+
} as {
|
|
83
|
+
show: () => void
|
|
84
|
+
hide: () => void
|
|
85
|
+
toggle: () => void
|
|
86
|
+
cancel: () => void
|
|
87
|
+
})
|
|
82
88
|
|
|
83
89
|
onMount(() => {
|
|
84
90
|
document.addEventListener("keydown", handleKey)
|
|
@@ -107,7 +113,7 @@
|
|
|
107
113
|
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
108
114
|
<div
|
|
109
115
|
class="spectrum-Underlay is-open"
|
|
110
|
-
on:mousedown|self={cancel}
|
|
116
|
+
on:mousedown|self={() => cancel(ModalCancelFrom.OUTSIDE_CLICK)}
|
|
111
117
|
style="z-index:{zIndex || 999}"
|
|
112
118
|
>
|
|
113
119
|
<div
|
|
@@ -115,8 +121,14 @@
|
|
|
115
121
|
in:fade={{ duration: 200 }}
|
|
116
122
|
out:fade|local={{ duration: 200 }}
|
|
117
123
|
/>
|
|
118
|
-
<div
|
|
119
|
-
|
|
124
|
+
<div
|
|
125
|
+
class="modal-wrapper"
|
|
126
|
+
on:mousedown|self={() => cancel(ModalCancelFrom.OUTSIDE_CLICK)}
|
|
127
|
+
>
|
|
128
|
+
<div
|
|
129
|
+
class="modal-inner-wrapper"
|
|
130
|
+
on:mousedown|self={() => cancel(ModalCancelFrom.OUTSIDE_CLICK)}
|
|
131
|
+
>
|
|
120
132
|
<slot name="outside" />
|
|
121
133
|
<div
|
|
122
134
|
use:focusModal
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
import Icon from "../Icon/Icon.svelte"
|
|
11
11
|
import Context from "../context"
|
|
12
12
|
import ProgressCircle from "../ProgressCircle/ProgressCircle.svelte"
|
|
13
|
+
import { ModalCancelFrom } from "../constants"
|
|
13
14
|
|
|
14
15
|
export let title: string | undefined = undefined
|
|
15
16
|
export let size: "S" | "M" | "L" | "XL" = "S"
|
|
@@ -30,10 +31,7 @@
|
|
|
30
31
|
export let secondaryButtonWarning: boolean = false
|
|
31
32
|
export let custom: boolean = false
|
|
32
33
|
|
|
33
|
-
const { hide, cancel } = getContext(Context.Modal)
|
|
34
|
-
hide: () => void
|
|
35
|
-
cancel: () => void
|
|
36
|
-
}
|
|
34
|
+
const { hide, cancel } = getContext(Context.Modal)
|
|
37
35
|
|
|
38
36
|
let loading: boolean = false
|
|
39
37
|
|
|
@@ -59,7 +57,7 @@
|
|
|
59
57
|
async function close(): Promise<void> {
|
|
60
58
|
loading = true
|
|
61
59
|
if (!onCancel || (await onCancel()) !== keepOpen) {
|
|
62
|
-
cancel()
|
|
60
|
+
cancel(ModalCancelFrom.CANCEL_BUTTON)
|
|
63
61
|
}
|
|
64
62
|
loading = false
|
|
65
63
|
}
|
|
@@ -139,7 +137,11 @@
|
|
|
139
137
|
{/if}
|
|
140
138
|
{#if showCloseIcon}
|
|
141
139
|
<div class="close-icon">
|
|
142
|
-
<Icon
|
|
140
|
+
<Icon
|
|
141
|
+
hoverable
|
|
142
|
+
name="Close"
|
|
143
|
+
on:click={() => cancel(ModalCancelFrom.CLOSE_BUTTON)}
|
|
144
|
+
/>
|
|
143
145
|
</div>
|
|
144
146
|
{/if}
|
|
145
147
|
</div>
|
package/src/bbui.css
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* Custom variables */
|
|
1
2
|
:root {
|
|
2
3
|
--background: #ffffff;
|
|
3
4
|
--ink: #000000;
|
|
@@ -71,7 +72,6 @@
|
|
|
71
72
|
--font-serif: "Georgia", Cambria, Times New Roman, Times, serif;
|
|
72
73
|
--font-mono: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
|
|
73
74
|
monospace;
|
|
74
|
-
--spectrum-alias-body-text-font-family: var(--font-sans);
|
|
75
75
|
|
|
76
76
|
font-size: 16px;
|
|
77
77
|
--font-size-xs: 0.75rem;
|
|
@@ -116,9 +116,17 @@
|
|
|
116
116
|
--border-blue: 2px var(--blue) solid;
|
|
117
117
|
--border-transparent: 2px transparent solid;
|
|
118
118
|
|
|
119
|
-
--spectrum-alias-text-color-disabled: var(--spectrum-global-color-gray-600);
|
|
120
119
|
}
|
|
121
120
|
|
|
121
|
+
/* Spectrum overrides */
|
|
122
|
+
.spectrum {
|
|
123
|
+
--spectrum-alias-body-text-font-family: var(--font-sans) !important;
|
|
124
|
+
--spectrum-global-font-family-base: var(--font-sans) !important;
|
|
125
|
+
--spectrum-global-font-line-height-small: 1.4 !important;
|
|
126
|
+
--spectrum-alias-text-color-disabled: var(--spectrum-global-color-gray-600) !important;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/* Generic styles */
|
|
122
130
|
a {
|
|
123
131
|
text-decoration: none;
|
|
124
132
|
}
|
package/src/constants.ts
CHANGED
|
@@ -21,3 +21,10 @@ export enum TooltipType {
|
|
|
21
21
|
Positive = "positive",
|
|
22
22
|
Negative = "negative",
|
|
23
23
|
}
|
|
24
|
+
|
|
25
|
+
export const enum ModalCancelFrom {
|
|
26
|
+
CLOSE_BUTTON = "close_button",
|
|
27
|
+
CANCEL_BUTTON = "cancel_button",
|
|
28
|
+
ESCAPE_KEY = "escape_key",
|
|
29
|
+
OUTSIDE_CLICK = "outside_click",
|
|
30
|
+
}
|