@budibase/bbui 1.0.27-alpha.0 → 1.0.27

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": "1.0.27-alpha.0",
4
+ "version": "1.0.27",
5
5
  "license": "MPL-2.0",
6
6
  "svelte": "src/index.js",
7
7
  "module": "dist/bbui.es.js",
@@ -82,5 +82,5 @@
82
82
  "svelte-flatpickr": "^3.2.3",
83
83
  "svelte-portal": "^1.0.0"
84
84
  },
85
- "gitHead": "02df048171ce810a73736b68d1209e06c46f854d"
85
+ "gitHead": "163f4718da912a0a1dff90fe0b9a846d92b1dea9"
86
86
  }
@@ -80,8 +80,4 @@
80
80
  .active svg {
81
81
  color: var(--spectrum-global-color-blue-600);
82
82
  }
83
-
84
- .spectrum-ActionButton-label {
85
- padding-bottom: 2px;
86
- }
87
83
  </style>
@@ -6,8 +6,6 @@
6
6
  import { generateID } from "../../utils/helpers"
7
7
  import Icon from "../../Icon/Icon.svelte"
8
8
  import Link from "../../Link/Link.svelte"
9
- import Tag from "../../Tags/Tag.svelte"
10
- import Tags from "../../Tags/Tags.svelte"
11
9
 
12
10
  const BYTES_IN_KB = 1000
13
11
  const BYTES_IN_MB = 1000000
@@ -20,8 +18,6 @@
20
18
  export let handleFileTooLarge = null
21
19
  export let gallery = true
22
20
  export let error = null
23
- export let fileTags = []
24
- export let maximum = null
25
21
 
26
22
  const dispatch = createEventDispatcher()
27
23
  const imageExtensions = [
@@ -188,118 +184,103 @@
188
184
  {/each}
189
185
  {/if}
190
186
  {/if}
191
- {#if !maximum || (maximum && value?.length < maximum)}
192
- <div
193
- class="spectrum-Dropzone"
194
- class:is-invalid={!!error}
195
- class:disabled
196
- role="region"
197
- tabindex="0"
198
- on:dragover={handleDragOver}
199
- on:dragleave={handleDragLeave}
200
- on:dragenter={handleDragOver}
201
- on:drop={handleDrop}
202
- class:is-dragged={fileDragged}
203
- >
204
- <div class="spectrum-IllustratedMessage spectrum-IllustratedMessage--cta">
205
- <input
206
- id={fieldId}
207
- {disabled}
208
- type="file"
209
- multiple
210
- on:change={handleFile}
187
+ <div
188
+ class="spectrum-Dropzone"
189
+ class:is-invalid={!!error}
190
+ class:disabled
191
+ role="region"
192
+ tabindex="0"
193
+ on:dragover={handleDragOver}
194
+ on:dragleave={handleDragLeave}
195
+ on:dragenter={handleDragOver}
196
+ on:drop={handleDrop}
197
+ class:is-dragged={fileDragged}
198
+ >
199
+ <div class="spectrum-IllustratedMessage spectrum-IllustratedMessage--cta">
200
+ <input
201
+ id={fieldId}
202
+ {disabled}
203
+ type="file"
204
+ multiple
205
+ on:change={handleFile}
206
+ />
207
+ <svg
208
+ class="spectrum-IllustratedMessage-illustration"
209
+ width="125"
210
+ height="60"
211
+ viewBox="0 0 199 97.7"
212
+ >
213
+ <defs>
214
+ <style>
215
+ .cls-1,
216
+ .cls-2 {
217
+ fill: none;
218
+ stroke-linecap: round;
219
+ stroke-linejoin: round;
220
+ }
221
+ .cls-1 {
222
+ stroke-width: 3px;
223
+ }
224
+ .cls-2 {
225
+ stroke-width: 2px;
226
+ }
227
+ </style>
228
+ </defs>
229
+ <path
230
+ class="cls-1"
231
+ d="M110.53,85.66,100.26,95.89a1.09,1.09,0,0,1-1.52,0L88.47,85.66"
211
232
  />
212
- <svg
213
- class="spectrum-IllustratedMessage-illustration"
214
- width="125"
215
- height="60"
216
- viewBox="0 0 199 97.7"
217
- >
218
- <defs>
219
- <style>
220
- .cls-1,
221
- .cls-2 {
222
- fill: none;
223
- stroke-linecap: round;
224
- stroke-linejoin: round;
225
- }
226
- .cls-1 {
227
- stroke-width: 3px;
228
- }
229
- .cls-2 {
230
- stroke-width: 2px;
231
- }
232
- </style>
233
- </defs>
234
- <path
235
- class="cls-1"
236
- d="M110.53,85.66,100.26,95.89a1.09,1.09,0,0,1-1.52,0L88.47,85.66"
237
- />
238
- <line class="cls-1" x1="99.5" y1="95.5" x2="99.5" y2="58.5" />
239
- <path class="cls-1" d="M105.5,73.5h19a2,2,0,0,0,2-2v-43" />
240
- <path
241
- class="cls-1"
242
- d="M126.5,22.5h-19a2,2,0,0,1-2-2V1.5h-31a2,2,0,0,0-2,2v68a2,2,0,0,0,2,2h19"
243
- />
244
- <line class="cls-1" x1="105.5" y1="1.5" x2="126.5" y2="22.5" />
245
- <path
246
- class="cls-2"
247
- d="M47.93,50.49a5,5,0,1,0-4.83-5A4.93,4.93,0,0,0,47.93,50.49Z"
248
- />
249
- <path
250
- class="cls-2"
251
- d="M36.6,65.93,42.05,60A2.06,2.06,0,0,1,45,60l12.68,13.2"
252
- />
253
- <path
254
- class="cls-2"
255
- d="M3.14,73.23,22.42,53.76a1.65,1.65,0,0,1,2.38,0l19.05,19.7"
256
- />
257
- <path
258
- class="cls-1"
259
- d="M139.5,36.5H196A1.49,1.49,0,0,1,197.5,38V72A1.49,1.49,0,0,1,196,73.5H141A1.49,1.49,0,0,1,139.5,72V32A1.49,1.49,0,0,1,141,30.5H154a2.43,2.43,0,0,1,1.67.66l6,5.66"
260
- />
261
- <rect
262
- class="cls-1"
263
- x="1.5"
264
- y="34.5"
265
- width="58"
266
- height="39"
267
- rx="2"
268
- ry="2"
269
- />
270
- </svg>
271
- <h2
272
- class="spectrum-Heading spectrum-Heading--sizeL spectrum-Heading--light spectrum-IllustratedMessage-heading"
233
+ <line class="cls-1" x1="99.5" y1="95.5" x2="99.5" y2="58.5" />
234
+ <path class="cls-1" d="M105.5,73.5h19a2,2,0,0,0,2-2v-43" />
235
+ <path
236
+ class="cls-1"
237
+ d="M126.5,22.5h-19a2,2,0,0,1-2-2V1.5h-31a2,2,0,0,0-2,2v68a2,2,0,0,0,2,2h19"
238
+ />
239
+ <line class="cls-1" x1="105.5" y1="1.5" x2="126.5" y2="22.5" />
240
+ <path
241
+ class="cls-2"
242
+ d="M47.93,50.49a5,5,0,1,0-4.83-5A4.93,4.93,0,0,0,47.93,50.49Z"
243
+ />
244
+ <path
245
+ class="cls-2"
246
+ d="M36.6,65.93,42.05,60A2.06,2.06,0,0,1,45,60l12.68,13.2"
247
+ />
248
+ <path
249
+ class="cls-2"
250
+ d="M3.14,73.23,22.42,53.76a1.65,1.65,0,0,1,2.38,0l19.05,19.7"
251
+ />
252
+ <path
253
+ class="cls-1"
254
+ d="M139.5,36.5H196A1.49,1.49,0,0,1,197.5,38V72A1.49,1.49,0,0,1,196,73.5H141A1.49,1.49,0,0,1,139.5,72V32A1.49,1.49,0,0,1,141,30.5H154a2.43,2.43,0,0,1,1.67.66l6,5.66"
255
+ />
256
+ <rect
257
+ class="cls-1"
258
+ x="1.5"
259
+ y="34.5"
260
+ width="58"
261
+ height="39"
262
+ rx="2"
263
+ ry="2"
264
+ />
265
+ </svg>
266
+ <h2
267
+ class="spectrum-Heading spectrum-Heading--sizeL spectrum-Heading--light spectrum-IllustratedMessage-heading"
268
+ >
269
+ Drag and drop your file
270
+ </h2>
271
+ {#if !disabled}
272
+ <p
273
+ class="spectrum-Body spectrum-Body--sizeS spectrum-IllustratedMessage-description"
273
274
  >
274
- Drag and drop your file
275
- </h2>
276
- {#if !disabled}
277
- <p
278
- class="spectrum-Body spectrum-Body--sizeS spectrum-IllustratedMessage-description"
279
- >
280
- <label for={fieldId} class="spectrum-Link">
281
- Select a file to upload
282
- </label>
283
- <br />
284
- from your computer
285
- </p>
286
- {#if fileTags.length}
287
- <Tags>
288
- <div class="tags">
289
- {#each fileTags as tag}
290
- <div class="tag">
291
- <Tag>
292
- {tag}
293
- </Tag>
294
- </div>
295
- {/each}
296
- </div>
297
- </Tags>
298
- {/if}
299
- {/if}
300
- </div>
275
+ <label for={fieldId} class="spectrum-Link">
276
+ Select a file to upload
277
+ </label>
278
+ <br />
279
+ from your computer
280
+ </p>
281
+ {/if}
301
282
  </div>
302
- {/if}
283
+ </div>
303
284
  </div>
304
285
 
305
286
  <style>
@@ -409,15 +390,4 @@
409
390
  .disabled .spectrum-Heading--sizeL {
410
391
  color: var(--spectrum-alias-text-color-disabled);
411
392
  }
412
-
413
- .tags {
414
- margin-top: 20px;
415
- display: flex;
416
- flex-wrap: wrap;
417
- justify-content: center;
418
- }
419
-
420
- .tag {
421
- margin-top: 8px;
422
- }
423
393
  </style>
@@ -7,7 +7,7 @@
7
7
  export let disabled = false
8
8
  export let id = null
9
9
  export let updateOnChange = true
10
- export let quiet = false
10
+
11
11
  const dispatch = createEventDispatcher()
12
12
  let focus = false
13
13
 
@@ -41,7 +41,6 @@
41
41
  <div class="spectrum-Search" class:is-disabled={disabled}>
42
42
  <div
43
43
  class="spectrum-Textfield"
44
- class:spectrum-Textfield--quiet={quiet}
45
44
  class:is-focused={focus}
46
45
  class:is-disabled={disabled}
47
46
  >
@@ -25,9 +25,7 @@
25
25
  class="spectrum-Switch-input"
26
26
  />
27
27
  <span class="spectrum-Switch-switch" />
28
- {#if text}
29
- <label class="spectrum-Switch-label" for={id}>{text}</label>
30
- {/if}
28
+ <label class="spectrum-Switch-label" for={id}>{text}</label>
31
29
  </div>
32
30
 
33
31
  <style>
@@ -7,8 +7,6 @@
7
7
  export let disabled = false
8
8
  export let error = null
9
9
  export let id = null
10
- export let height = null
11
- export let minHeight = null
12
10
  export const getCaretPosition = () => ({
13
11
  start: textarea.selectionStart,
14
12
  end: textarea.selectionEnd,
@@ -24,8 +22,6 @@
24
22
  </script>
25
23
 
26
24
  <div
27
- style={(height ? `height: ${height}px;` : "") +
28
- (minHeight ? `min-height: ${minHeight}px` : "")}
29
25
  class="spectrum-Textfield spectrum-Textfield--multiline"
30
26
  class:is-invalid={!!error}
31
27
  class:is-disabled={disabled}
@@ -12,8 +12,6 @@
12
12
  export let processFiles = undefined
13
13
  export let handleFileTooLarge = undefined
14
14
  export let gallery = true
15
- export let fileTags = []
16
- export let maximum = undefined
17
15
 
18
16
  const dispatch = createEventDispatcher()
19
17
  const onChange = e => {
@@ -31,8 +29,6 @@
31
29
  {processFiles}
32
30
  {handleFileTooLarge}
33
31
  {gallery}
34
- {fileTags}
35
- {maximum}
36
32
  on:change={onChange}
37
33
  />
38
34
  </Field>
@@ -9,7 +9,6 @@
9
9
  export let labelPosition = "above"
10
10
  export let error = null
11
11
  export let options = []
12
- export let direction = "vertical"
13
12
  export let getOptionLabel = option => extractProperty(option, "label")
14
13
  export let getOptionValue = option => extractProperty(option, "value")
15
14
 
@@ -32,7 +31,6 @@
32
31
  {disabled}
33
32
  {value}
34
33
  {options}
35
- {direction}
36
34
  {getOptionLabel}
37
35
  {getOptionValue}
38
36
  on:change={onChange}
@@ -9,7 +9,6 @@
9
9
  export let placeholder = null
10
10
  export let disabled = false
11
11
  export let updateOnChange = true
12
- export let quiet = false
13
12
 
14
13
  const dispatch = createEventDispatcher()
15
14
  const onChange = e => {
@@ -24,7 +23,6 @@
24
23
  {disabled}
25
24
  {value}
26
25
  {placeholder}
27
- {quiet}
28
26
  on:change={onChange}
29
27
  on:click
30
28
  on:input
@@ -10,8 +10,6 @@
10
10
  export let disabled = false
11
11
  export let error = null
12
12
  export let getCaretPosition = null
13
- export let height = null
14
- export let minHeight = null
15
13
 
16
14
  const dispatch = createEventDispatcher()
17
15
  const onChange = e => {
@@ -27,8 +25,6 @@
27
25
  {disabled}
28
26
  {value}
29
27
  {placeholder}
30
- {height}
31
- {minHeight}
32
28
  on:change={onChange}
33
29
  />
34
30
  </Field>
@@ -9,7 +9,6 @@
9
9
  export let size = "M"
10
10
  export let hoverable = false
11
11
  export let disabled = false
12
- export let color
13
12
 
14
13
  $: rotation = getRotation(direction)
15
14
 
@@ -26,9 +25,7 @@
26
25
  focusable="false"
27
26
  aria-hidden={hidden}
28
27
  aria-label={name}
29
- style={`transform: rotate(${rotation}deg); ${
30
- color ? `color: ${color};` : ""
31
- }`}
28
+ style={`transform: rotate(${rotation}deg)`}
32
29
  >
33
30
  <use xlink:href="#spectrum-icon-18-{name}" />
34
31
  </svg>
@@ -19,7 +19,6 @@
19
19
  <div class="icon-container">
20
20
  <div
21
21
  class="icon"
22
- class:icon-small={size === "M" || size === "S"}
23
22
  on:mouseover={() => (showTooltip = true)}
24
23
  on:mouseleave={() => (showTooltip = false)}
25
24
  >
@@ -45,7 +44,6 @@
45
44
  }
46
45
  .container {
47
46
  display: flex;
48
- align-items: center;
49
47
  }
50
48
  .icon-container {
51
49
  position: relative;
@@ -66,8 +64,4 @@
66
64
  .icon {
67
65
  transform: scale(0.75);
68
66
  }
69
- .icon-small {
70
- margin-top: -2px;
71
- margin-bottom: -5px;
72
- }
73
67
  </style>
@@ -63,9 +63,6 @@
63
63
  .gap-L {
64
64
  grid-gap: var(--spectrum-alias-grid-gutter-medium);
65
65
  }
66
- .gap-XL {
67
- grid-gap: var(--spectrum-alias-grid-gutter-large);
68
- }
69
66
  .horizontal.gap-S :global(*) + :global(*) {
70
67
  margin-left: var(--spectrum-alias-grid-gutter-xsmall);
71
68
  }
@@ -18,23 +18,10 @@
18
18
  export let disabled = false
19
19
  export let showDivider = true
20
20
 
21
- export let showSecondaryButton = false
22
- export let secondaryButtonText = undefined
23
- export let secondaryAction = undefined
24
- export let secondaryButtonWarning = false
25
-
26
21
  const { hide, cancel } = getContext(Context.Modal)
27
22
  let loading = false
28
23
  $: confirmDisabled = disabled || loading
29
24
 
30
- async function secondary() {
31
- loading = true
32
- if (!secondaryAction || (await secondaryAction()) !== false) {
33
- hide()
34
- }
35
- loading = false
36
- }
37
-
38
25
  async function confirm() {
39
26
  loading = true
40
27
  if (!onConfirm || (await onConfirm()) !== false) {
@@ -86,18 +73,6 @@
86
73
  class="spectrum-ButtonGroup spectrum-Dialog-buttonGroup spectrum-Dialog-buttonGroup--noFooter"
87
74
  >
88
75
  <slot name="footer" />
89
-
90
- {#if showSecondaryButton && secondaryButtonText && secondaryAction}
91
- <div class="secondary-action">
92
- <Button
93
- group
94
- secondary
95
- warning={secondaryButtonWarning}
96
- on:click={secondary}>{secondaryButtonText}</Button
97
- >
98
- </div>
99
- {/if}
100
-
101
76
  {#if showCancelButton}
102
77
  <Button group secondary on:click={close}>{cancelText}</Button>
103
78
  {/if}
@@ -161,8 +136,4 @@
161
136
  display: flex;
162
137
  justify-content: space-between;
163
138
  }
164
-
165
- .secondary-action {
166
- margin-right: auto;
167
- }
168
139
  </style>
@@ -5,7 +5,7 @@
5
5
  export let icon = ""
6
6
 
7
7
  const dispatch = createEventDispatcher()
8
- let selected = getContext("tab")
8
+ const selected = getContext("tab")
9
9
  let tab
10
10
  let tabInfo
11
11
 
@@ -16,8 +16,8 @@
16
16
  // We just need to get this off the main thread to fix this, by using
17
17
  // a 0ms timeout.
18
18
  setTimeout(() => {
19
- tabInfo = tab?.getBoundingClientRect()
20
- if (tabInfo && $selected.title === title) {
19
+ tabInfo = tab.getBoundingClientRect()
20
+ if ($selected.title === title) {
21
21
  $selected.info = tabInfo
22
22
  }
23
23
  }, 0)
@@ -6,13 +6,9 @@
6
6
  export let selected
7
7
  export let vertical = false
8
8
  export let noPadding = false
9
- // added as a separate option as noPadding is used for vertical padding
10
- export let noHorizPadding = false
11
9
  export let quiet = false
12
10
  export let emphasized = false
13
11
 
14
- let thisSelected = undefined
15
-
16
12
  let _id = id()
17
13
  const tab = writable({ title: selected, id: _id, emphasized })
18
14
  setContext("tab", tab)
@@ -22,19 +18,9 @@
22
18
  const dispatch = createEventDispatcher()
23
19
 
24
20
  $: {
25
- if (thisSelected !== selected) {
26
- thisSelected = selected
27
- dispatch("select", thisSelected)
28
- } else if ($tab.title !== thisSelected) {
29
- thisSelected = $tab.title
21
+ if ($tab.title !== selected) {
30
22
  selected = $tab.title
31
- dispatch("select", thisSelected)
32
- }
33
- if ($tab.title !== thisSelected) {
34
- tab.update(state => {
35
- state.title = thisSelected
36
- return state
37
- })
23
+ dispatch("select", selected)
38
24
  }
39
25
  }
40
26
 
@@ -73,7 +59,6 @@
73
59
  <div
74
60
  bind:this={container}
75
61
  class:quiet
76
- class:noHorizPadding
77
62
  class="selected-border spectrum-Tabs {quiet &&
78
63
  'spectrum-Tabs--quiet'} spectrum-Tabs--{vertical
79
64
  ? 'vertical'
@@ -114,9 +99,6 @@
114
99
  .spectrum-Tabs--horizontal .spectrum-Tabs-selectionIndicator {
115
100
  bottom: 0 !important;
116
101
  }
117
- .noHorizPadding {
118
- padding: 0;
119
- }
120
102
  .noPadding {
121
103
  margin: 0;
122
104
  }
@@ -13,9 +13,3 @@
13
13
  >
14
14
  <slot />
15
15
  </p>
16
-
17
- <style>
18
- p {
19
- font-weight: 600;
20
- }
21
- </style>
package/src/index.js CHANGED
@@ -59,7 +59,6 @@ export { default as Badge } from "./Badge/Badge.svelte"
59
59
  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
- export { default as Banner } from "./Banner/Banner.svelte"
63
62
 
64
63
  // Typography
65
64
  export { default as Body } from "./Typography/Body.svelte"
@@ -1,59 +0,0 @@
1
- <script>
2
- import { createEventDispatcher } from "svelte"
3
-
4
- let dispatch = createEventDispatcher()
5
-
6
- export let type = "info"
7
- export let icon = "Info"
8
- export let size = "S"
9
- export let extraButtonText
10
- export let extraButtonAction
11
-
12
- let show = true
13
-
14
- function clear() {
15
- show = false
16
- dispatch("change")
17
- }
18
- </script>
19
-
20
- {#if show}
21
- <div class="spectrum-Toast spectrum-Toast--{type}">
22
- <svg
23
- class="spectrum-Icon spectrum-Icon--size{size} spectrum-Toast-typeIcon"
24
- focusable="false"
25
- aria-hidden="true"
26
- >
27
- <use xlink:href="#spectrum-icon-18-{icon}" />
28
- </svg>
29
- <div class="spectrum-Toast-body">
30
- <div class="spectrum-Toast-content">
31
- <slot />
32
- </div>
33
- {#if extraButtonText && extraButtonAction}
34
- <button
35
- class="spectrum-Button spectrum-Button--sizeM spectrum-Button--overBackground spectrum-Button--quiet"
36
- on:click={extraButtonAction}
37
- >
38
- <span class="spectrum-Button-label">{extraButtonText}</span>
39
- </button>
40
- {/if}
41
- </div>
42
- <div class="spectrum-Toast-buttons">
43
- <button
44
- class="spectrum-ClearButton spectrum-ClearButton--overBackground spectrum-ClearButton--size{size}"
45
- on:click={clear}
46
- >
47
- <div class="spectrum-ClearButton-fill">
48
- <svg
49
- class="spectrum-ClearButton-icon spectrum-Icon spectrum-UIIcon-Cross100"
50
- focusable="false"
51
- aria-hidden="true"
52
- >
53
- <use xlink:href="#spectrum-css-icon-Cross100" />
54
- </svg>
55
- </div>
56
- </button>
57
- </div>
58
- </div>
59
- {/if}