@stubber/form-fields 1.0.3 → 1.0.4
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/fields/component_parts/arraybuilder/FieldWrapper.svelte +21 -16
- package/dist/fields/components/Arraybuilder.svelte +8 -11
- package/dist/fields/components/Checkbox.svelte +8 -7
- package/dist/fields/components/CheckboxAutocomplete.svelte +4 -1
- package/dist/fields/components/Contactselector.svelte +28 -15
- package/dist/fields/components/Currency.svelte +22 -17
- package/dist/fields/components/Fieldbuilder.svelte +15 -12
- package/dist/fields/components/Fieldsbuilder.svelte +3 -3
- package/dist/fields/components/File.svelte +14 -10
- package/dist/fields/components/Heading.svelte +1 -1
- package/dist/fields/components/Jsoneditor.svelte +50 -119
- package/dist/fields/components/Multicheckbox.svelte +8 -7
- package/dist/fields/components/Note.svelte +10 -10
- package/dist/fields/components/Number.svelte +3 -3
- package/dist/fields/components/Radio.svelte +14 -13
- package/dist/fields/components/Scrollandreaddisplay.svelte +10 -8
- package/dist/fields/components/Section.svelte +58 -35
- package/dist/fields/components/Select.svelte +22 -14
- package/dist/fields/components/Signature.svelte +8 -13
- package/dist/fields/components/SmartText.svelte +25 -11
- package/dist/fields/components/Telephone.svelte +13 -8
- package/dist/fields/components/Text.svelte +10 -9
- package/package.json +2 -2
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import _ from "lodash-es";
|
|
3
3
|
|
|
4
|
+
import { Button } from "@stubber/ui/button";
|
|
5
|
+
|
|
4
6
|
// fieldWrapper
|
|
5
7
|
export let field;
|
|
6
8
|
export let fieldcomponent;
|
|
@@ -39,31 +41,34 @@
|
|
|
39
41
|
}
|
|
40
42
|
</script>
|
|
41
43
|
|
|
42
|
-
<div class="flex items-
|
|
44
|
+
<div class="flex items-center pb-6">
|
|
43
45
|
<div class="relative flex-grow-0 mr-2">
|
|
44
|
-
<
|
|
46
|
+
<Button
|
|
45
47
|
on:click={() => reorder(false)}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
+
variant="ghost"
|
|
49
|
+
size="icon"
|
|
50
|
+
class="flex items-center justify-center w-5 h-5 "
|
|
48
51
|
>
|
|
49
|
-
<i class="fa-regular fa-angle-up" />
|
|
50
|
-
</
|
|
51
|
-
<
|
|
52
|
+
<i class="fa-sharp fa-regular fa-angle-up text-base" />
|
|
53
|
+
</Button>
|
|
54
|
+
<Button
|
|
52
55
|
on:click={() => reorder(true)}
|
|
53
|
-
|
|
54
|
-
|
|
56
|
+
variant="ghost"
|
|
57
|
+
size="icon"
|
|
58
|
+
class="flex items-center justify-center w-5 h-5"
|
|
55
59
|
>
|
|
56
|
-
<i class="fa-regular fa-angle-down" />
|
|
57
|
-
</
|
|
60
|
+
<i class="fa-sharp fa-regular fa-angle-down text-base" />
|
|
61
|
+
</Button>
|
|
58
62
|
</div>
|
|
59
63
|
<div class="flex-grow">
|
|
60
64
|
<svelte:component this={fieldcomponent} {...$$props} field_wrapper={null} />
|
|
61
65
|
</div>
|
|
62
|
-
<
|
|
66
|
+
<Button
|
|
63
67
|
on:click={removeEntry}
|
|
64
|
-
|
|
65
|
-
|
|
68
|
+
variant="destructive"
|
|
69
|
+
size="icon"
|
|
70
|
+
class="flex-grow-0 flex items-center justify-center w-6 h-6 ml-2 "
|
|
66
71
|
>
|
|
67
|
-
<i class="fa-regular fa-
|
|
68
|
-
</
|
|
72
|
+
<i class="fa-regular fa-trash-alt text-xs" />
|
|
73
|
+
</Button>
|
|
69
74
|
</div>
|
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
import { onMount } from "svelte";
|
|
6
6
|
import { deepEqual } from "fast-equals";
|
|
7
7
|
|
|
8
|
+
import { Button } from "@stubber/ui/button";
|
|
9
|
+
import { Label } from "@stubber/ui/label";
|
|
10
|
+
|
|
8
11
|
export let form;
|
|
9
12
|
export let field;
|
|
10
13
|
|
|
@@ -73,9 +76,9 @@
|
|
|
73
76
|
|
|
74
77
|
{#if new_entry}
|
|
75
78
|
<div class="flex flex-col w-full text-surface-900">
|
|
76
|
-
<
|
|
79
|
+
<Label for="input_{state_key}" class="block {hide_label ? 'hidden' : ''}">
|
|
77
80
|
{label}
|
|
78
|
-
</
|
|
81
|
+
</Label>
|
|
79
82
|
<div class="relative mt-2 rounded-md">
|
|
80
83
|
{#if rendered_fields}
|
|
81
84
|
{#each rendered_fields as initial_field_spec (initial_field_spec?.__key)}
|
|
@@ -83,19 +86,13 @@
|
|
|
83
86
|
{/each}
|
|
84
87
|
{/if}
|
|
85
88
|
<div>
|
|
86
|
-
<button
|
|
87
|
-
type="button"
|
|
88
|
-
on:click={() => addEntry()}
|
|
89
|
-
class="text-xl w-8 h-8 border border-dashed bg-surface-0 border-primary-300 hover:bg-primary-500 hover:text-surface-0 hover:border-0 active:bg-primary-500 active:text-surface-0 active:border-0 rounded text-primary-500"
|
|
90
|
-
>
|
|
89
|
+
<Button type="button" size="icon" variant="outline" on:click={() => addEntry()} class="">
|
|
91
90
|
<i class="fa-regular fa-plus" />
|
|
92
|
-
</
|
|
91
|
+
</Button>
|
|
93
92
|
</div>
|
|
94
93
|
</div>
|
|
95
94
|
{#if validationMessage}
|
|
96
|
-
<
|
|
97
|
-
{validationMessage}
|
|
98
|
-
</p>
|
|
95
|
+
<Label class={!isValid ? `text-danger-500` : `text-success-500`}>{validationMessage}</Label>
|
|
99
96
|
{/if}
|
|
100
97
|
</div>
|
|
101
98
|
{/if}
|
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
import { onMount, onDestroy } from "svelte";
|
|
6
6
|
import { writable } from "svelte/store";
|
|
7
7
|
|
|
8
|
+
import { Checkbox } from "@stubber/ui/checkbox";
|
|
9
|
+
import { Label } from "@stubber/ui/label";
|
|
10
|
+
|
|
8
11
|
export let field;
|
|
9
12
|
|
|
10
13
|
const internal = writable();
|
|
@@ -74,10 +77,11 @@
|
|
|
74
77
|
{#if $internal}
|
|
75
78
|
<div class="flex flex-col w-full {!isValid ? `text-danger-500` : `text-surface-900`}">
|
|
76
79
|
<div class="flex space-x-3 relative mt-2 items-center">
|
|
77
|
-
<
|
|
80
|
+
<Label for="input_{state_key}" class="block {hide_label ? 'hidden' : ''}">
|
|
78
81
|
{label}
|
|
79
|
-
</
|
|
80
|
-
|
|
82
|
+
</Label>
|
|
83
|
+
|
|
84
|
+
<Checkbox
|
|
81
85
|
on:keydown={(e) => {
|
|
82
86
|
if (e.key === "Enter") {
|
|
83
87
|
e.preventDefault();
|
|
@@ -86,15 +90,12 @@
|
|
|
86
90
|
type="checkbox"
|
|
87
91
|
id="input_{state_key}"
|
|
88
92
|
placeholder={label}
|
|
89
|
-
class="block w-5 h-5 rounded-md text-label focus:outline-primary-400"
|
|
90
93
|
name={state_key}
|
|
91
94
|
bind:checked={$internal.checked}
|
|
92
95
|
/>
|
|
93
96
|
</div>
|
|
94
97
|
{#if validationMessage}
|
|
95
|
-
<
|
|
96
|
-
{validationMessage}
|
|
97
|
-
</p>
|
|
98
|
+
<Label class={!isValid ? `text-danger-500` : `text-success-500`}>{validationMessage}</Label>
|
|
98
99
|
{/if}
|
|
99
100
|
</div>
|
|
100
101
|
{/if}
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
import Checkbox from "./Checkbox.svelte";
|
|
4
4
|
import SmartText from "./SmartText.svelte";
|
|
5
5
|
import * as utils from "../../utils/index.js";
|
|
6
|
+
|
|
7
|
+
import { Label } from "@stubber/ui/label";
|
|
8
|
+
|
|
6
9
|
let clickOutside = utils.clickOutside;
|
|
7
10
|
|
|
8
11
|
export let field;
|
|
@@ -76,7 +79,7 @@
|
|
|
76
79
|
select_option(option);
|
|
77
80
|
}}
|
|
78
81
|
/>
|
|
79
|
-
<
|
|
82
|
+
<Label for="fieldtype_radio_{option}">{option}</Label>
|
|
80
83
|
</div>
|
|
81
84
|
{/each}
|
|
82
85
|
</div>
|
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
import { writable } from "svelte/store";
|
|
7
7
|
import { syncStoreToStore } from "../../utils/syncing";
|
|
8
8
|
|
|
9
|
+
import { Label } from "@stubber/ui/label";
|
|
10
|
+
import { Button } from "@stubber/ui/button";
|
|
11
|
+
|
|
9
12
|
export let form;
|
|
10
13
|
export let field;
|
|
11
14
|
|
|
@@ -238,9 +241,9 @@
|
|
|
238
241
|
}}
|
|
239
242
|
class="relative flex flex-col w-full text-surface-900"
|
|
240
243
|
>
|
|
241
|
-
<
|
|
244
|
+
<Label for="input_{state_key}" class="block {hide_label ? 'hidden' : ''}">
|
|
242
245
|
{label}
|
|
243
|
-
</
|
|
246
|
+
</Label>
|
|
244
247
|
<div class="relative flex mt-2 rounded-md">
|
|
245
248
|
<input
|
|
246
249
|
on:keydown={(e) => {
|
|
@@ -271,9 +274,12 @@
|
|
|
271
274
|
type="select"
|
|
272
275
|
id="input_mask{state_key}"
|
|
273
276
|
placeholder={label}
|
|
274
|
-
class="
|
|
275
|
-
|
|
276
|
-
|
|
277
|
+
class="bg-gradient-to-b from-[#2727271F] to-[#27272719] shadow-select
|
|
278
|
+
flex h-7 w-full items-center justify-between rounded px-3 py-2
|
|
279
|
+
text-sm
|
|
280
|
+
[&>span]:line-clamp-1 aria-[invalid]:border-destructive
|
|
281
|
+
placeholder:text-black
|
|
282
|
+
{!isValid ? 'ring-danger-500' : 'ring-surface-300 focus:ring-primary-400'}"
|
|
277
283
|
bind:value={filter_text}
|
|
278
284
|
autocomplete="off"
|
|
279
285
|
/>
|
|
@@ -295,7 +301,9 @@
|
|
|
295
301
|
<div use:teleport class="z-10 w-full absolute inset-y-[70px]">
|
|
296
302
|
{#if items?.length > 0}
|
|
297
303
|
<ul
|
|
298
|
-
class="
|
|
304
|
+
class="bg-popover text-popover-foreground relative min-w-[8rem]
|
|
305
|
+
overflow-hidden rounded-md border shadow-md outline-none
|
|
306
|
+
max-h-[200px] overflow-y-auto w-full p-1"
|
|
299
307
|
>
|
|
300
308
|
{#each items as item, index (item?._value?._key)}
|
|
301
309
|
<li
|
|
@@ -305,7 +313,14 @@
|
|
|
305
313
|
>
|
|
306
314
|
<button
|
|
307
315
|
on:click|preventDefault={() => setSelected(item)}
|
|
308
|
-
class="selectitem
|
|
316
|
+
class="selectitem relative flex w-full cursor-default
|
|
317
|
+
select-none items-center rounded-sm py-1 pl-8 pr-2
|
|
318
|
+
text-sm outline-none hover:bg-accent
|
|
319
|
+
hover:text-accent-foreground
|
|
320
|
+
data-[highlighted]:bg-accent
|
|
321
|
+
data-[highlighted]:text-accent-foreground
|
|
322
|
+
data-[disabled]:pointer-events-none
|
|
323
|
+
data-[disabled]:opacity-50"
|
|
309
324
|
>
|
|
310
325
|
{item._label}
|
|
311
326
|
{#if item.is_personal}
|
|
@@ -314,7 +329,7 @@
|
|
|
314
329
|
</div>
|
|
315
330
|
{/if}
|
|
316
331
|
{#if item?._value?._key == $internal?.selected_item?._value?._key}
|
|
317
|
-
<i class="
|
|
332
|
+
<i class="absolute left-2 h-3.5 w-3.5 fa-regular fa-check" />
|
|
318
333
|
{/if}
|
|
319
334
|
</button>
|
|
320
335
|
</li>
|
|
@@ -329,20 +344,18 @@
|
|
|
329
344
|
{/if}
|
|
330
345
|
</div>
|
|
331
346
|
{/if}
|
|
332
|
-
<div class="mt-
|
|
333
|
-
<
|
|
347
|
+
<div class="mt-1 ml-auto">
|
|
348
|
+
<Button
|
|
334
349
|
on:click={toggleCreateNew}
|
|
335
|
-
|
|
350
|
+
variant="ghost"
|
|
336
351
|
class="text-surface-500 text-sm hover:text-surface-700"
|
|
337
352
|
>
|
|
338
353
|
<i class="fa-regular fa-plus" />
|
|
339
354
|
Create new contact
|
|
340
|
-
</
|
|
355
|
+
</Button>
|
|
341
356
|
</div>
|
|
342
357
|
{#if validationMessage}
|
|
343
|
-
<
|
|
344
|
-
{validationMessage}
|
|
345
|
-
</p>
|
|
358
|
+
<Label class={!isValid ? `text-danger-500` : `text-success-500`}>{validationMessage}</Label>
|
|
346
359
|
{/if}
|
|
347
360
|
</div>
|
|
348
361
|
{/if}
|
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
import getSymbolFromCurrency from "currency-symbol-map";
|
|
9
9
|
import * as utils from "../../utils/index.js";
|
|
10
10
|
|
|
11
|
+
import { Button } from "@stubber/ui/button";
|
|
12
|
+
import { Label } from "@stubber/ui/label";
|
|
13
|
+
|
|
11
14
|
export let field;
|
|
12
15
|
|
|
13
16
|
let { clickOutside, inputRegexMask } = utils;
|
|
@@ -176,13 +179,13 @@
|
|
|
176
179
|
}}
|
|
177
180
|
class="flex flex-col w-full text-surface-900"
|
|
178
181
|
>
|
|
179
|
-
<
|
|
182
|
+
<Label for="input_{state_key}" class={hide_label ? "hidden" : ""}>
|
|
180
183
|
{label}
|
|
181
|
-
</
|
|
184
|
+
</Label>
|
|
182
185
|
<div
|
|
183
|
-
class="flex
|
|
186
|
+
class="bg-gradient-to-b from-[#2727271F] to-[#27272719] shadow-select ring-offset-background focus-visible:ring-ring aria-[invalid]:border-destructive flex h-7 w-full items-center justify-between rounded px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 relative {!isValid
|
|
184
187
|
? 'ring-danger-500'
|
|
185
|
-
: 'ring-surface-300 focus:ring-primary-400'}
|
|
188
|
+
: 'ring-surface-300 focus:ring-primary-400'} "
|
|
186
189
|
>
|
|
187
190
|
<div class="pointer-events-none flex items-center pl-3">
|
|
188
191
|
<span class="text-label text-surface-600">
|
|
@@ -198,7 +201,7 @@
|
|
|
198
201
|
use:inputRegexMask={currencyRegex}
|
|
199
202
|
id="input_{state_key}"
|
|
200
203
|
placeholder={label}
|
|
201
|
-
class="
|
|
204
|
+
class="bg-transparent w-full focus:outline-none text-surface-900 placeholder:text-surface-400 ml-2"
|
|
202
205
|
name={state_key}
|
|
203
206
|
inputmode="decimal"
|
|
204
207
|
bind:value={$internal.raw}
|
|
@@ -206,40 +209,44 @@
|
|
|
206
209
|
/>
|
|
207
210
|
<!-- Here be selector stuff -->
|
|
208
211
|
{#if currencyList && !currencyFixed}
|
|
209
|
-
<
|
|
212
|
+
<Button
|
|
213
|
+
variant="ghost"
|
|
210
214
|
type="button"
|
|
211
215
|
on:click={toggleCurrencySelectorPopout}
|
|
212
|
-
class="w-20 pl-3 space-x-2 flex items-center
|
|
216
|
+
class="w-20 pl-3 space-x-2 flex items-center"
|
|
213
217
|
>
|
|
214
218
|
<span class="text-field text-surface-700">{$internal?.currencycode}</span>
|
|
215
219
|
<i
|
|
216
220
|
class="text-surface-700 fa fa-solid fa-xs fa-caret-{show_currency_list ? 'up' : 'down'}"
|
|
217
221
|
/>
|
|
218
|
-
</
|
|
222
|
+
</Button>
|
|
219
223
|
{/if}
|
|
220
224
|
{#if show_currency_list && currencyList}
|
|
221
225
|
<div class="z-10 absolute inset-y-[42px] right-0">
|
|
222
226
|
<ul
|
|
223
|
-
class="items block max-h-[250px] overflow-y-auto w-[250px] md:w-[450px] bg-
|
|
227
|
+
class="items block max-h-[250px] overflow-y-auto w-[250px] md:w-[450px] bg-popover text-popover-foreground relative z-50 min-w-[8rem] overflow-hidden rounded border shadow-md outline-none p-1"
|
|
224
228
|
>
|
|
225
229
|
{#each currencyList as item}
|
|
226
230
|
<!-- {#if currencyWhitelist.contains(item.value) && !currencyBlacklist.contains(item.value)} -->
|
|
227
231
|
<li
|
|
228
232
|
class="{item.value == $internal?.currencycode
|
|
229
233
|
? 'selecteditem'
|
|
230
|
-
: ''} group
|
|
234
|
+
: ''} group relative flex w-full cursor-default select-none items-center rounded-sm py-1 pl-8 pr-2 text-sm outline-none
|
|
235
|
+
hover:bg-accent hover:text-accent-foreground"
|
|
231
236
|
>
|
|
237
|
+
<span class="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
238
|
+
{#if item.value == $internal?.currencycode}
|
|
239
|
+
<i class="fa-regular fa-check h-4 w-4" />
|
|
240
|
+
{/if}
|
|
241
|
+
</span>
|
|
232
242
|
<button
|
|
233
243
|
on:click|preventDefault={() => setSelectedCurrency(item)}
|
|
234
244
|
on:focusout={(e) => handleFocusOut(e)}
|
|
235
|
-
class="
|
|
245
|
+
class=" w-full flex items-center space-x-3 selectitem focus:outline-none"
|
|
236
246
|
>
|
|
237
247
|
<span class="text-surface-900 text-field">{item.value}</span>
|
|
238
248
|
<span class="text-surface-700 text-field">{item.symbol}</span>
|
|
239
249
|
<span class="text-surface-500 text-field">{item.name}</span>
|
|
240
|
-
{#if item.value == $internal?.currencycode}
|
|
241
|
-
<i class="text-primary-400 ml-auto fa-regular fa-check" />
|
|
242
|
-
{/if}
|
|
243
250
|
</button>
|
|
244
251
|
</li>
|
|
245
252
|
<!-- {/if} -->
|
|
@@ -250,9 +257,7 @@
|
|
|
250
257
|
<!-- Here end selector stuff -->
|
|
251
258
|
</div>
|
|
252
259
|
{#if validationMessage}
|
|
253
|
-
<
|
|
254
|
-
{validationMessage}
|
|
255
|
-
</p>
|
|
260
|
+
<Label class={!isValid ? `text-danger-500` : `text-success-500`}>{validationMessage}</Label>
|
|
256
261
|
{/if}
|
|
257
262
|
</div>
|
|
258
263
|
{/if}
|
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
import FieldWrapper from "../component_parts/fieldbuilder/FieldWrapper.svelte";
|
|
10
10
|
import * as utils from "../../utils/index.js";
|
|
11
11
|
|
|
12
|
+
import { Checkbox } from "@stubber/ui/checkbox";
|
|
13
|
+
import { Label } from "@stubber/ui/label";
|
|
14
|
+
import { Button } from "@stubber/ui/button";
|
|
15
|
+
import * as Accordion from "@stubber/ui/accordion";
|
|
16
|
+
|
|
12
17
|
export let form;
|
|
13
18
|
export let field;
|
|
14
19
|
|
|
@@ -209,20 +214,20 @@
|
|
|
209
214
|
</script>
|
|
210
215
|
|
|
211
216
|
<div class="flex flex-col w-full text-surface-900">
|
|
212
|
-
<
|
|
217
|
+
<Label for="input_{state_key}" class="block text-label {hide_label ? 'hidden' : ''}">
|
|
213
218
|
{label}
|
|
214
|
-
</
|
|
215
|
-
<div class
|
|
216
|
-
<div class="bg-
|
|
219
|
+
</Label>
|
|
220
|
+
<div class>
|
|
221
|
+
<div class="bg-white">
|
|
217
222
|
{#if $field?.data?.base?.name}
|
|
218
223
|
<div class="text-xs text-surface-700 p-1 border-b">
|
|
219
224
|
{$field.data.base.name}
|
|
220
225
|
</div>
|
|
221
226
|
{/if}
|
|
222
|
-
<div class="flex items-center justify-start
|
|
227
|
+
<div class="flex items-center justify-start">
|
|
223
228
|
{#if !$field?.spec?.params?.hide_demo}
|
|
224
229
|
<button type="button" on:click={() => (views.demo = !views.demo)}>
|
|
225
|
-
<div class="p-2 hover:bg-
|
|
230
|
+
<div class="p-2 hover:bg-surface-100 rounded-sm">
|
|
226
231
|
<div class="text-sm italic text-surface-500 flex justify-between items-center">
|
|
227
232
|
<i class="fa-regular fa-input-pipe {views.demo ? 'text-primary-500' : ''}" />
|
|
228
233
|
</div>
|
|
@@ -230,21 +235,21 @@
|
|
|
230
235
|
</button>
|
|
231
236
|
{/if}
|
|
232
237
|
<button type="button" on:click={() => (views.settings = !views.settings)}>
|
|
233
|
-
<div class="p-2 hover:bg-
|
|
238
|
+
<div class="p-2 hover:bg-surface-100 rounded-sm">
|
|
234
239
|
<div class="text-sm italic text-surface-500 flex justify-between items-center">
|
|
235
240
|
<i class="fa-regular fa-gear {views.settings ? 'text-primary-500' : ''}" />
|
|
236
241
|
</div>
|
|
237
242
|
</div>
|
|
238
243
|
</button>
|
|
239
244
|
<button type="button" on:click={() => (views.demo_data = !views.demo_data)}>
|
|
240
|
-
<div class="p-2 hover:bg-
|
|
245
|
+
<div class="p-2 hover:bg-surface-100 rounded-sm">
|
|
241
246
|
<div class="text-sm italic text-surface-500 flex justify-between items-center">
|
|
242
247
|
<i class="fa-regular fa-database {views.demo_data ? 'text-primary-500' : ''}" />
|
|
243
248
|
</div>
|
|
244
249
|
</div>
|
|
245
250
|
</button>
|
|
246
251
|
<button type="button" on:click={() => (views.advanced = !views.advanced)}>
|
|
247
|
-
<div class="p-2 hover:bg-
|
|
252
|
+
<div class="p-2 hover:bg-surface-100 rounded-sm">
|
|
248
253
|
<div class="text-sm italic text-surface-500 flex justify-between items-center">
|
|
249
254
|
<i class="fa-regular fa-brackets-curly {views.advanced ? 'text-primary-500' : ''}" />
|
|
250
255
|
</div>
|
|
@@ -333,8 +338,6 @@
|
|
|
333
338
|
</div>
|
|
334
339
|
</div>
|
|
335
340
|
{#if validationMessage}
|
|
336
|
-
<
|
|
337
|
-
{validationMessage}
|
|
338
|
-
</p>
|
|
341
|
+
<Label class={!isValid ? `text-danger-500` : `text-success-500`}>{validationMessage}</Label>
|
|
339
342
|
{/if}
|
|
340
343
|
</div>
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
import { onMount } from "svelte";
|
|
7
7
|
import { deepEqual } from "fast-equals";
|
|
8
8
|
|
|
9
|
+
import { Label } from "@stubber/ui/label";
|
|
10
|
+
|
|
9
11
|
export let form;
|
|
10
12
|
export let field;
|
|
11
13
|
|
|
@@ -115,8 +117,6 @@
|
|
|
115
117
|
<Form bind:form={settings_form} {initial_form} {dependencies} />
|
|
116
118
|
{/if}
|
|
117
119
|
{#if validationMessage}
|
|
118
|
-
<
|
|
119
|
-
{validationMessage}
|
|
120
|
-
</p>
|
|
120
|
+
<Label class={!isValid ? `text-danger-500` : `text-success-500`}>{validationMessage}</Label>
|
|
121
121
|
{/if}
|
|
122
122
|
</div>
|
|
@@ -6,6 +6,10 @@
|
|
|
6
6
|
import { syncStoreToStore } from "../../utils/syncing";
|
|
7
7
|
import { writable } from "svelte/store";
|
|
8
8
|
|
|
9
|
+
import { Input } from "@stubber/ui/input";
|
|
10
|
+
import { Label } from "@stubber/ui/label";
|
|
11
|
+
import { Button } from "@stubber/ui/button";
|
|
12
|
+
|
|
9
13
|
export let form;
|
|
10
14
|
export let field;
|
|
11
15
|
|
|
@@ -162,18 +166,18 @@
|
|
|
162
166
|
</script>
|
|
163
167
|
|
|
164
168
|
{#if $internal}
|
|
165
|
-
<
|
|
169
|
+
<Label
|
|
166
170
|
for="input_{state_key}"
|
|
167
171
|
class="block text-label text-surface-900 {hide_label ? 'hidden' : ''}"
|
|
168
172
|
>
|
|
169
173
|
{label}
|
|
170
|
-
</
|
|
174
|
+
</Label>
|
|
171
175
|
<div class="w-full flex flex-col {!isValid ? 'border-b border-warning-500' : ''}">
|
|
172
176
|
<Dropzone on:drop={handleFilesSelect} disabled={limit_remaining <= 0}>
|
|
173
|
-
<div class="flex justify-center h-full flex-col text-center">
|
|
177
|
+
<div class="flex justify-center h-full flex-col text-center rounded-sm">
|
|
174
178
|
<div>
|
|
175
|
-
<p class="
|
|
176
|
-
<p class="
|
|
179
|
+
<p class=" text-surface-800">Drop files to upload</p>
|
|
180
|
+
<p class=" text-surface-800">
|
|
177
181
|
Or click <span
|
|
178
182
|
class="text-primary-500 hover:text-primary-400 hover:underline cursor-pointer"
|
|
179
183
|
>here</span
|
|
@@ -211,9 +215,11 @@
|
|
|
211
215
|
{item?.file?.filename ?? item?.file?.name ?? item?.file?.path}
|
|
212
216
|
</p>
|
|
213
217
|
</div>
|
|
214
|
-
<
|
|
218
|
+
<Button
|
|
215
219
|
type="button"
|
|
216
|
-
|
|
220
|
+
variant="destructive"
|
|
221
|
+
size="icon"
|
|
222
|
+
class="shrink-0 ml-1 p-1 px-2 fa-solid fa-2xs fa-x border-surface-0 "
|
|
217
223
|
on:click={() => {
|
|
218
224
|
removeFile(item);
|
|
219
225
|
}}
|
|
@@ -223,8 +229,6 @@
|
|
|
223
229
|
</div>
|
|
224
230
|
</div>
|
|
225
231
|
{#if validationMessage}
|
|
226
|
-
<
|
|
227
|
-
{validationMessage}
|
|
228
|
-
</p>
|
|
232
|
+
<Label class={!isValid ? `text-danger-500` : `text-success-500`}>{validationMessage}</Label>
|
|
229
233
|
{/if}
|
|
230
234
|
{/if}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
<div class="flex flex-col w-full mb-2">
|
|
11
11
|
{#if heading_text}
|
|
12
|
-
<h1 class="text-xl text-
|
|
12
|
+
<h1 class="text-xl text-black tracking-tight font-semibold mt-4">{heading_text}</h1>
|
|
13
13
|
{/if}
|
|
14
14
|
{#if subheading_text}
|
|
15
15
|
<h2 class="text-sm text-surface-500 whitespace-pre-wrap">{subheading_text}</h2>
|