@budibase/bbui 3.4.23 → 3.5.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/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.23",
4
+ "version": "3.5.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": "fb5453d9f7c6b72b1ba00564564ce966536a19de"
102
+ "gitHead": "fe6e04cd92a531e0a9b2c4c3b1915c84c5a74ac3"
103
103
  }
@@ -1,14 +1,14 @@
1
- <script>
1
+ <script lang="ts">
2
2
  import "@spectrum-css/textfield/dist/index-vars.css"
3
3
  import { createEventDispatcher } from "svelte"
4
4
 
5
5
  export let value = ""
6
- export let placeholder = null
6
+ export let placeholder: string | undefined = undefined
7
7
  export let disabled = false
8
8
  export let readonly = false
9
- export let id = null
10
- export let height = null
11
- export let minHeight = null
9
+ export let id: string | undefined = undefined
10
+ export let height: string | number | undefined = undefined
11
+ export let minHeight: string | number | undefined = undefined
12
12
  export const getCaretPosition = () => ({
13
13
  start: textarea.selectionStart,
14
14
  end: textarea.selectionEnd,
@@ -16,18 +16,21 @@
16
16
  export let align = null
17
17
 
18
18
  let focus = false
19
- let textarea
19
+ let textarea: any
20
20
  const dispatch = createEventDispatcher()
21
- const onChange = event => {
21
+ const onChange = (event: any) => {
22
22
  dispatch("change", event.target.value)
23
23
  focus = false
24
24
  }
25
25
 
26
- const getStyleString = (attribute, value) => {
26
+ const getStyleString = (
27
+ attribute: string,
28
+ value: string | number | undefined
29
+ ) => {
27
30
  if (!attribute || value == null) {
28
31
  return ""
29
32
  }
30
- if (isNaN(value)) {
33
+ if (typeof value === "number" && isNaN(value)) {
31
34
  return `${attribute}:${value};`
32
35
  }
33
36
  return `${attribute}:${value}px;`
@@ -1,21 +1,21 @@
1
- <script>
1
+ <script lang="ts">
2
2
  import Field from "./Field.svelte"
3
3
  import TextArea from "./Core/TextArea.svelte"
4
4
  import { createEventDispatcher } from "svelte"
5
5
 
6
- export let value = null
7
- export let label = null
8
- export let labelPosition = "above"
9
- export let placeholder = null
6
+ export let value: string | undefined = undefined
7
+ export let label: string | undefined = undefined
8
+ export let labelPosition: string = "above"
9
+ export let placeholder: string | undefined = undefined
10
10
  export let disabled = false
11
- export let error = null
12
- export let getCaretPosition = null
13
- export let height = null
14
- export let minHeight = null
15
- export let helpText = null
11
+ export let error: string | undefined = undefined
12
+ export let getCaretPosition: any = undefined
13
+ export let height: string | number | undefined = undefined
14
+ export let minHeight: string | number | undefined = undefined
15
+ export let helpText: string | undefined = undefined
16
16
 
17
17
  const dispatch = createEventDispatcher()
18
- const onChange = e => {
18
+ const onChange = (e: any) => {
19
19
  value = e.detail
20
20
  dispatch("change", e.detail)
21
21
  }
@@ -24,7 +24,6 @@
24
24
  <Field {helpText} {label} {labelPosition} {error}>
25
25
  <TextArea
26
26
  bind:getCaretPosition
27
- {error}
28
27
  {disabled}
29
28
  {value}
30
29
  {placeholder}
@@ -1,6 +1,7 @@
1
1
  <script>
2
2
  import "@spectrum-css/inlinealert/dist/index-vars.css"
3
3
  import Button from "../Button/Button.svelte"
4
+ import Icon from "../Icon/Icon.svelte"
4
5
 
5
6
  export let type = "info"
6
7
  export let header = ""
@@ -8,6 +9,8 @@
8
9
  export let onConfirm = undefined
9
10
  export let buttonText = ""
10
11
  export let cta = false
12
+ export let link = ""
13
+ export let linkText = ""
11
14
 
12
15
  $: icon = selectIcon(type)
13
16
  // if newlines used, convert them to different elements
@@ -49,6 +52,19 @@
49
52
  >
50
53
  </div>
51
54
  {/if}
55
+ {#if link && linkText}
56
+ <div id="docs-link">
57
+ <a
58
+ href={link}
59
+ target="_blank"
60
+ rel="noopener noreferrer"
61
+ class="docs-link"
62
+ >
63
+ {linkText}
64
+ <Icon name="LinkOut" size="XS" />
65
+ </a>
66
+ </div>
67
+ {/if}
52
68
  </div>
53
69
 
54
70
  <style>
@@ -64,4 +80,21 @@
64
80
  margin: 0;
65
81
  border-width: 1px;
66
82
  }
83
+
84
+ a {
85
+ color: white;
86
+ }
87
+
88
+ #docs-link {
89
+ padding-top: 10px;
90
+ display: flex;
91
+ align-items: center;
92
+ gap: 5px;
93
+ }
94
+
95
+ #docs-link > * {
96
+ display: flex;
97
+ align-items: center;
98
+ gap: 5px;
99
+ }
67
100
  </style>
@@ -4,7 +4,7 @@
4
4
 
5
5
  export let title
6
6
  export let icon = ""
7
- export let id
7
+ export let id = undefined
8
8
  export let href = "#"
9
9
  export let link = false
10
10
 
@@ -8,11 +8,13 @@
8
8
  export let invalid: boolean = false
9
9
  export let disabled: boolean = false
10
10
  export let closable: boolean = false
11
+ export let emphasized: boolean = false
11
12
  </script>
12
13
 
13
14
  <div
14
15
  class:is-invalid={invalid}
15
16
  class:is-disabled={disabled}
17
+ class:is-emphasized={emphasized}
16
18
  class="spectrum-Tags-item"
17
19
  role="listitem"
18
20
  >
@@ -40,4 +42,9 @@
40
42
  margin-bottom: 0;
41
43
  margin-top: 0;
42
44
  }
45
+
46
+ .is-emphasized {
47
+ border-color: var(--spectrum-global-color-blue-700);
48
+ color: var(--spectrum-global-color-blue-700);
49
+ }
43
50
  </style>