@budibase/bbui 1.1.25-alpha.2 → 1.1.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.1.25-alpha.2",
4
+ "version": "1.1.27",
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.1.25-alpha.2",
41
+ "@budibase/string-templates": "^1.1.27",
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": "d65ab980afd4cbd07fcf0491af97ac5a60db01be"
88
+ "gitHead": "ce7b4989f2a9e575370f4ccfd7fa9d8db27dfc13"
89
89
  }
@@ -4,7 +4,7 @@
4
4
  ["XXS", "--spectrum-alias-avatar-size-50"],
5
5
  ["XS", "--spectrum-alias-avatar-size-75"],
6
6
  ["S", "--spectrum-alias-avatar-size-200"],
7
- ["M", "--spectrum-alias-avatar-size-400"],
7
+ ["M", "--spectrum-alias-avatar-size-300"],
8
8
  ["L", "--spectrum-alias-avatar-size-500"],
9
9
  ["XL", "--spectrum-alias-avatar-size-600"],
10
10
  ["XXL", "--spectrum-alias-avatar-size-700"],
@@ -13,19 +13,6 @@
13
13
  export let url = ""
14
14
  export let disabled = false
15
15
  export let initials = "JD"
16
-
17
- const DefaultColor = "#3aab87"
18
-
19
- $: color = getColor(initials)
20
-
21
- const getColor = initials => {
22
- if (!initials?.length) {
23
- return DefaultColor
24
- }
25
- const code = initials[0].toLowerCase().charCodeAt(0)
26
- const hue = ((code % 26) / 26) * 360
27
- return `hsl(${hue}, 50%, 50%)`
28
- }
29
16
  </script>
30
17
 
31
18
  {#if url}
@@ -38,11 +25,10 @@
38
25
  />
39
26
  {:else}
40
27
  <div
41
- class="spectrum-Avatar"
42
28
  class:is-disabled={disabled}
43
29
  style="width: var({sizes.get(size)}); height: var({sizes.get(
44
30
  size
45
- )}); font-size: calc(var({sizes.get(size)}) / 2); background: {color};"
31
+ )}); font-size: calc(var({sizes.get(size)}) / 2)"
46
32
  >
47
33
  {initials || ""}
48
34
  </div>
@@ -54,6 +40,7 @@
54
40
  display: grid;
55
41
  place-items: center;
56
42
  font-weight: 600;
43
+ background: #3aab87;
57
44
  border-radius: 50%;
58
45
  overflow: hidden;
59
46
  user-select: none;
@@ -13,7 +13,6 @@
13
13
  export let readonly = false
14
14
  export let autocomplete = false
15
15
  export let sort = false
16
- export let autoWidth = false
17
16
 
18
17
  const dispatch = createEventDispatcher()
19
18
  $: selectedLookupMap = getSelectedLookupMap(value)
@@ -86,5 +85,4 @@
86
85
  {getOptionValue}
87
86
  onSelectOption={toggleOption}
88
87
  {sort}
89
- {autoWidth}
90
88
  />
@@ -17,6 +17,7 @@
17
17
  export let autoWidth = false
18
18
  export let autocomplete = false
19
19
  export let sort = false
20
+
20
21
  const dispatch = createEventDispatcher()
21
22
  let open = false
22
23
  $: fieldText = getFieldText(value, options, placeholder)
@@ -14,7 +14,7 @@
14
14
  export let getOptionLabel = option => option
15
15
  export let getOptionValue = option => option
16
16
  export let sort = false
17
- export let autoWidth = false
17
+
18
18
  const dispatch = createEventDispatcher()
19
19
  const onChange = e => {
20
20
  value = e.detail
@@ -33,7 +33,6 @@
33
33
  {sort}
34
34
  {getOptionLabel}
35
35
  {getOptionValue}
36
- {autoWidth}
37
36
  on:change={onChange}
38
37
  on:click
39
38
  />
@@ -0,0 +1,53 @@
1
+ <script>
2
+ import { View } from "svench";
3
+ import DetailSummary from "./DetailSummary.svelte";
4
+ </script>
5
+
6
+ <svelte:head>
7
+ <link href="https://cdn.jsdelivr.net/npm/remixicon@2.5.0/fonts/remixicon.css" rel="stylesheet">
8
+ </svelte:head>
9
+
10
+ <style>
11
+ div {
12
+ display: flex;
13
+ flex-direction: column;
14
+ justify-content: flex-start;
15
+ align-items: stretch;
16
+ gap: var(--spacing-m);
17
+ width: 120px;
18
+ }
19
+ </style>
20
+
21
+ <View name="default">
22
+ <div>
23
+ <DetailSummary name="Category 1">
24
+ <span>1</span>
25
+ <span>2</span>
26
+ <span>3</span>
27
+ <span>4</span>
28
+ </DetailSummary>
29
+ <DetailSummary name="Category 2">
30
+ <span>1</span>
31
+ <span>2</span>
32
+ <span>3</span>
33
+ <span>4</span>
34
+ </DetailSummary>
35
+ </div>
36
+ </View>
37
+
38
+ <View name="thin">
39
+ <div>
40
+ <DetailSummary thin name="Category 1">
41
+ <span>1</span>
42
+ <span>2</span>
43
+ <span>3</span>
44
+ <span>4</span>
45
+ </DetailSummary>
46
+ <DetailSummary thin name="Category 2">
47
+ <span>1</span>
48
+ <span>2</span>
49
+ <span>3</span>
50
+ <span>4</span>
51
+ </DetailSummary>
52
+ </div>
53
+ </View>
@@ -37,7 +37,6 @@
37
37
  export let autoSortColumns = true
38
38
  export let compact = false
39
39
  export let customPlaceholder = false
40
- export let showHeaderBorder = true
41
40
  export let placeholderText = "No rows found"
42
41
 
43
42
  const dispatch = createEventDispatcher()
@@ -287,7 +286,6 @@
287
286
  <div class="spectrum-Table-head">
288
287
  {#if showEditColumn}
289
288
  <div
290
- class:noBorderHeader={!showHeaderBorder}
291
289
  class="spectrum-Table-headCell spectrum-Table-headCell--divider spectrum-Table-headCell--edit"
292
290
  >
293
291
  {#if allowSelectRows}
@@ -303,7 +301,6 @@
303
301
  {#each fields as field}
304
302
  <div
305
303
  class="spectrum-Table-headCell"
306
- class:noBorderHeader={!showHeaderBorder}
307
304
  class:spectrum-Table-headCell--alignCenter={schema[field]
308
305
  .align === "Center"}
309
306
  class:spectrum-Table-headCell--alignRight={schema[field].align ===
@@ -351,7 +348,6 @@
351
348
  <div class="spectrum-Table-row">
352
349
  {#if showEditColumn}
353
350
  <div
354
- class:noBorderCheckbox={!showHeaderBorder}
355
351
  class="spectrum-Table-cell spectrum-Table-cell--divider spectrum-Table-cell--edit"
356
352
  on:click={e => {
357
353
  toggleSelectRow(row)
@@ -485,18 +481,6 @@
485
481
  .spectrum-Table-headCell:last-of-type {
486
482
  border-right: var(--table-border);
487
483
  }
488
-
489
- .noBorderHeader {
490
- border-top: none !important;
491
- border-right: none !important;
492
- border-left: none !important;
493
- }
494
-
495
- .noBorderCheckbox {
496
- border-top: none !important;
497
- border-right: none !important;
498
- }
499
-
500
484
  .spectrum-Table-headCell--alignCenter {
501
485
  justify-content: center;
502
486
  }
@@ -515,7 +499,7 @@
515
499
  z-index: 3;
516
500
  }
517
501
  .spectrum-Table-headCell .title {
518
- overflow: visible;
502
+ overflow: hidden;
519
503
  text-overflow: ellipsis;
520
504
  }
521
505
  .spectrum-Table-headCell:hover .spectrum-Table-editIcon {
@@ -578,7 +562,7 @@
578
562
  gap: 4px;
579
563
  border-bottom: 1px solid var(--spectrum-alias-border-color-mid);
580
564
  background-color: var(--table-bg);
581
- z-index: auto;
565
+ z-index: 1;
582
566
  }
583
567
  .spectrum-Table-cell--divider {
584
568
  padding-right: var(--cell-padding);
@@ -586,7 +570,6 @@
586
570
  .spectrum-Table-cell--divider + .spectrum-Table-cell {
587
571
  padding-left: var(--cell-padding);
588
572
  }
589
-
590
573
  .spectrum-Table-cell--edit {
591
574
  position: sticky;
592
575
  left: 0;
package/src/index.js CHANGED
@@ -23,8 +23,6 @@ export { default as Icon, directions } from "./Icon/Icon.svelte"
23
23
  export { default as Toggle } from "./Form/Toggle.svelte"
24
24
  export { default as RadioGroup } from "./Form/RadioGroup.svelte"
25
25
  export { default as Checkbox } from "./Form/Checkbox.svelte"
26
- export { default as InputDropdown } from "./Form/InputDropdown.svelte"
27
- export { default as PickerDropdown } from "./Form/PickerDropdown.svelte"
28
26
  export { default as DetailSummary } from "./DetailSummary/DetailSummary.svelte"
29
27
  export { default as Popover } from "./Popover/Popover.svelte"
30
28
  export { default as ProgressBar } from "./ProgressBar/ProgressBar.svelte"
@@ -60,15 +58,12 @@ export { default as Pagination } from "./Pagination/Pagination.svelte"
60
58
  export { default as Badge } from "./Badge/Badge.svelte"
61
59
  export { default as StatusLight } from "./StatusLight/StatusLight.svelte"
62
60
  export { default as ColorPicker } from "./ColorPicker/ColorPicker.svelte"
63
- export { default as IconPicker } from "./IconPicker/IconPicker.svelte"
64
61
  export { default as InlineAlert } from "./InlineAlert/InlineAlert.svelte"
65
62
  export { default as Banner } from "./Banner/Banner.svelte"
66
63
  export { default as BannerDisplay } from "./Banner/BannerDisplay.svelte"
67
64
  export { default as MarkdownEditor } from "./Markdown/MarkdownEditor.svelte"
68
65
  export { default as MarkdownViewer } from "./Markdown/MarkdownViewer.svelte"
69
66
  export { default as RichTextField } from "./Form/RichTextField.svelte"
70
- export { default as List } from "./List/List.svelte"
71
- export { default as ListItem } from "./List/ListItem.svelte"
72
67
  export { default as IconSideNav } from "./IconSideNav/IconSideNav.svelte"
73
68
  export { default as IconSideNavItem } from "./IconSideNav/IconSideNavItem.svelte"
74
69
  export { default as Slider } from "./Form/Slider.svelte"
@@ -76,7 +71,6 @@ export { default as Slider } from "./Form/Slider.svelte"
76
71
  // Renderers
77
72
  export { default as BoldRenderer } from "./Table/BoldRenderer.svelte"
78
73
  export { default as CodeRenderer } from "./Table/CodeRenderer.svelte"
79
- export { default as InternalRenderer } from "./Table/InternalRenderer.svelte"
80
74
 
81
75
  // Typography
82
76
  export { default as Body } from "./Typography/Body.svelte"
@@ -1,218 +0,0 @@
1
- <script>
2
- import "@spectrum-css/inputgroup/dist/index-vars.css"
3
- import "@spectrum-css/popover/dist/index-vars.css"
4
- import "@spectrum-css/menu/dist/index-vars.css"
5
- import { fly } from "svelte/transition"
6
- import { createEventDispatcher } from "svelte"
7
- import clickOutside from "../../Actions/click_outside"
8
-
9
- export let inputValue
10
- export let dropdownValue
11
- export let id = null
12
- export let inputType = "text"
13
- export let placeholder = "Choose an option or type"
14
- export let disabled = false
15
- export let readonly = false
16
- export let updateOnChange = true
17
- export let error = null
18
- export let options = []
19
- export let getOptionLabel = option => extractProperty(option, "label")
20
- export let getOptionValue = option => extractProperty(option, "value")
21
-
22
- export let isOptionSelected = () => false
23
-
24
- const dispatch = createEventDispatcher()
25
- let open = false
26
- let focus = false
27
-
28
- $: fieldText = getFieldText(dropdownValue, options, placeholder)
29
-
30
- const getFieldText = (dropdownValue, options, placeholder) => {
31
- // Always use placeholder if no value
32
- if (dropdownValue == null || dropdownValue === "") {
33
- return placeholder || "Choose an option or type"
34
- }
35
-
36
- // Wait for options to load if there is a value but no options
37
- if (!options?.length) {
38
- return ""
39
- }
40
-
41
- // Render the label if the selected option is found, otherwise raw value
42
- const selected = options.find(
43
- option => getOptionValue(option) === dropdownValue
44
- )
45
- return selected ? getOptionLabel(selected) : dropdownValue
46
- }
47
-
48
- const updateValue = newValue => {
49
- if (readonly) {
50
- return
51
- }
52
- dispatch("change", newValue)
53
- }
54
-
55
- const onFocus = () => {
56
- if (readonly) {
57
- return
58
- }
59
- focus = true
60
- }
61
-
62
- const onBlur = event => {
63
- if (readonly) {
64
- return
65
- }
66
- focus = false
67
- updateValue(event.target.value)
68
- }
69
-
70
- const onInput = event => {
71
- if (readonly || !updateOnChange) {
72
- return
73
- }
74
- updateValue(event.target.value)
75
- }
76
-
77
- const updateValueOnEnter = event => {
78
- if (readonly) {
79
- return
80
- }
81
- if (event.key === "Enter") {
82
- updateValue(event.target.value)
83
- }
84
- }
85
-
86
- const onClick = () => {
87
- dispatch("click")
88
- if (readonly) {
89
- return
90
- }
91
- open = true
92
- }
93
-
94
- const onPick = newValue => {
95
- dispatch("pick", newValue)
96
- open = false
97
- }
98
-
99
- const extractProperty = (value, property) => {
100
- if (value && typeof value === "object") {
101
- return value[property]
102
- }
103
- return value
104
- }
105
- </script>
106
-
107
- <div
108
- class="spectrum-InputGroup"
109
- class:is-invalid={!!error}
110
- class:is-disabled={disabled}
111
- >
112
- <div
113
- class="spectrum-Textfield spectrum-InputGroup-textfield"
114
- class:is-invalid={!!error}
115
- class:is-disabled={disabled}
116
- class:is-focused={focus}
117
- >
118
- <input
119
- {id}
120
- on:click
121
- on:blur
122
- on:focus
123
- on:input
124
- on:keyup
125
- on:blur={onBlur}
126
- on:focus={onFocus}
127
- on:input={onInput}
128
- on:keyup={updateValueOnEnter}
129
- value={inputValue || ""}
130
- placeholder={placeholder || ""}
131
- {disabled}
132
- {readonly}
133
- {inputType}
134
- class="spectrum-Textfield-input spectrum-InputGroup-input"
135
- />
136
- </div>
137
- <div style="width: 30%">
138
- <button
139
- {id}
140
- class="spectrum-Picker spectrum-Picker--sizeM override-borders"
141
- {disabled}
142
- class:is-open={open}
143
- aria-haspopup="listbox"
144
- on:mousedown={onClick}
145
- >
146
- <span class="spectrum-Picker-label">
147
- <div>
148
- {fieldText}
149
- </div></span
150
- >
151
- <svg
152
- class="spectrum-Icon spectrum-UIIcon-ChevronDown100 spectrum-Picker-menuIcon"
153
- focusable="false"
154
- aria-hidden="true"
155
- >
156
- <use xlink:href="#spectrum-css-icon-Chevron100" />
157
- </svg>
158
- </button>
159
- {#if open}
160
- <div
161
- use:clickOutside={() => (open = false)}
162
- transition:fly|local={{ y: -20, duration: 200 }}
163
- class="spectrum-Popover spectrum-Popover--bottom spectrum-Picker-popover is-open"
164
- >
165
- <ul class="spectrum-Menu" role="listbox">
166
- {#each options as option, idx}
167
- <li
168
- class="spectrum-Menu-item"
169
- class:is-selected={isOptionSelected(getOptionValue(option, idx))}
170
- role="option"
171
- aria-selected="true"
172
- tabindex="0"
173
- on:click={() => onPick(getOptionValue(option, idx))}
174
- >
175
- <span class="spectrum-Menu-itemLabel">
176
- {getOptionLabel(option, idx)}
177
- </span>
178
- <svg
179
- class="spectrum-Icon spectrum-UIIcon-Checkmark100 spectrum-Menu-checkmark spectrum-Menu-itemIcon"
180
- focusable="false"
181
- aria-hidden="true"
182
- >
183
- <use xlink:href="#spectrum-css-icon-Checkmark100" />
184
- </svg>
185
- </li>
186
- {/each}
187
- </ul>
188
- </div>
189
- {/if}
190
- </div>
191
- </div>
192
-
193
- <style>
194
- .spectrum-InputGroup {
195
- min-width: 0;
196
- width: 100%;
197
- }
198
-
199
- .spectrum-InputGroup-input {
200
- border-right-width: 1px;
201
- }
202
- .spectrum-Textfield {
203
- width: 100%;
204
- }
205
- .spectrum-Textfield-input {
206
- width: 0;
207
- }
208
-
209
- .override-borders {
210
- border-top-left-radius: 0px;
211
- border-bottom-left-radius: 0px;
212
- }
213
- .spectrum-Popover {
214
- max-height: 240px;
215
- z-index: 999;
216
- top: 100%;
217
- }
218
- </style>