@budibase/bbui 1.0.81-alpha.3 → 1.0.81-alpha.6
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 +1 -1
- package/dist/bbui.es.js.map +1 -1
- package/package.json +3 -3
- package/src/Banner/Banner.svelte +7 -0
- package/src/Banner/BannerDisplay.svelte +31 -0
- package/src/Stores/banner.js +37 -0
- package/src/index.js +2 -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.0.81-alpha.
|
|
4
|
+
"version": "1.0.81-alpha.6",
|
|
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.0.81-alpha.
|
|
41
|
+
"@budibase/string-templates": "^1.0.81-alpha.6",
|
|
42
42
|
"@spectrum-css/actionbutton": "^1.0.1",
|
|
43
43
|
"@spectrum-css/actiongroup": "^1.0.1",
|
|
44
44
|
"@spectrum-css/avatar": "^3.0.2",
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"svelte-flatpickr": "^3.2.3",
|
|
85
85
|
"svelte-portal": "^1.0.0"
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "86a54664fe53404c8b54d92266e9ef7f5e5a5a6c"
|
|
88
88
|
}
|
package/src/Banner/Banner.svelte
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import "@spectrum-css/toast/dist/index-vars.css"
|
|
3
|
+
import Portal from "svelte-portal"
|
|
4
|
+
import { banner } from "../Stores/banner"
|
|
5
|
+
import Banner from "./Banner.svelte"
|
|
6
|
+
import { fly } from "svelte/transition"
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<Portal target=".banner-container">
|
|
10
|
+
<div class="banner">
|
|
11
|
+
{#if $banner.message}
|
|
12
|
+
<div transition:fly={{ y: -30 }}>
|
|
13
|
+
<Banner
|
|
14
|
+
type={$banner.type}
|
|
15
|
+
extraButtonText={$banner.extraButtonText}
|
|
16
|
+
extraButtonAction={$banner.extraButtonAction}
|
|
17
|
+
on:change={$banner.onChange}
|
|
18
|
+
>
|
|
19
|
+
{$banner.message}
|
|
20
|
+
</Banner>
|
|
21
|
+
</div>
|
|
22
|
+
{/if}
|
|
23
|
+
</div>
|
|
24
|
+
</Portal>
|
|
25
|
+
|
|
26
|
+
<style>
|
|
27
|
+
.banner {
|
|
28
|
+
pointer-events: none;
|
|
29
|
+
width: 100%;
|
|
30
|
+
}
|
|
31
|
+
</style>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { writable } from "svelte/store"
|
|
2
|
+
|
|
3
|
+
export function createBannerStore() {
|
|
4
|
+
const DEFAULT_CONFIG = {}
|
|
5
|
+
|
|
6
|
+
const banner = writable(DEFAULT_CONFIG)
|
|
7
|
+
|
|
8
|
+
const show = async (
|
|
9
|
+
// eslint-disable-next-line
|
|
10
|
+
config = { message, type, extraButtonText, extraButtonAction, onChange }
|
|
11
|
+
) => {
|
|
12
|
+
banner.update(store => {
|
|
13
|
+
return {
|
|
14
|
+
...store,
|
|
15
|
+
...config,
|
|
16
|
+
}
|
|
17
|
+
})
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const showStatus = async () => {
|
|
21
|
+
const config = {
|
|
22
|
+
message: "Some systems are experiencing issues",
|
|
23
|
+
type: "negative",
|
|
24
|
+
extraButtonText: "View Status",
|
|
25
|
+
extraButtonAction: () => window.open("https://status.budibase.com/"),
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
await show(config)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return {
|
|
32
|
+
subscribe: banner.subscribe,
|
|
33
|
+
showStatus,
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const banner = createBannerStore()
|
package/src/index.js
CHANGED
|
@@ -60,6 +60,7 @@ export { default as StatusLight } from "./StatusLight/StatusLight.svelte"
|
|
|
60
60
|
export { default as ColorPicker } from "./ColorPicker/ColorPicker.svelte"
|
|
61
61
|
export { default as InlineAlert } from "./InlineAlert/InlineAlert.svelte"
|
|
62
62
|
export { default as Banner } from "./Banner/Banner.svelte"
|
|
63
|
+
export { default as BannerDisplay } from "./Banner/BannerDisplay.svelte"
|
|
63
64
|
export { default as MarkdownEditor } from "./Markdown/MarkdownEditor.svelte"
|
|
64
65
|
export { default as MarkdownViewer } from "./Markdown/MarkdownViewer.svelte"
|
|
65
66
|
export { default as RichTextField } from "./Form/RichTextField.svelte"
|
|
@@ -84,6 +85,7 @@ export { default as clickOutside } from "./Actions/click_outside"
|
|
|
84
85
|
|
|
85
86
|
// Stores
|
|
86
87
|
export { notifications, createNotificationStore } from "./Stores/notifications"
|
|
88
|
+
export { banner } from "./Stores/banner"
|
|
87
89
|
|
|
88
90
|
// Helpers
|
|
89
91
|
export * as Helpers from "./helpers"
|