@stubber/form-fields 1.0.5 → 1.0.10
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/README.md +21 -5
- package/dist/fields/components/Arraybuilder.svelte +1 -1
- package/dist/fields/components/Checkbox.svelte +2 -14
- package/dist/fields/components/Contactselector.svelte +49 -46
- package/dist/fields/components/Currency.svelte +1 -1
- package/dist/fields/components/Dataindication.svelte +9 -6
- package/dist/fields/components/Date.svelte +10 -8
- package/dist/fields/components/Datetime.svelte +10 -8
- package/dist/fields/components/Email.svelte +10 -7
- package/dist/fields/components/Fieldbuilder.svelte +1 -1
- package/dist/fields/components/Fieldsbuilder.svelte +3 -3
- package/dist/fields/components/File.svelte +1 -4
- package/dist/fields/components/Jsoneditor.svelte +3 -8
- package/dist/fields/components/Map.svelte +1 -1
- package/dist/fields/components/Note.svelte +4 -2
- package/dist/fields/components/Number.svelte +7 -6
- package/dist/fields/components/Objectbuilder.svelte +7 -5
- package/dist/fields/components/Qrcodescanner.svelte +4 -2
- package/dist/fields/components/Radio.svelte +3 -3
- package/dist/fields/components/Screenrecorder.svelte +4 -2
- package/dist/fields/components/Screenshot.svelte +4 -2
- package/dist/fields/components/Scrollandreaddisplay.svelte +2 -2
- package/dist/fields/components/Select.svelte +47 -31
- package/dist/fields/components/Selectresource.svelte +54 -37
- package/dist/fields/components/SmartText.svelte +30 -37
- package/dist/fields/components/Telephone.svelte +1 -1
- package/dist/fields/components/Text.svelte +4 -2
- package/dist/fields/components/Voicenote.svelte +4 -2
- package/package.json +11 -1
package/README.md
CHANGED
|
@@ -306,8 +306,24 @@ The dependencies prop is used by certain fields that only function with third pa
|
|
|
306
306
|
|
|
307
307
|
# Publishing
|
|
308
308
|
|
|
309
|
-
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
309
|
+
We use [semantic-release](https://github.com/semantic-release/semantic-release) to automate the versioning and package publishing process. To publish a new version of the package, follow these steps:
|
|
310
|
+
|
|
311
|
+
Simply make a commit with a message that follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification, and push it to the master branch. The commit message should include a type (feat, fix, chore, etc.) and an optional scope.
|
|
312
|
+
|
|
313
|
+
For example:
|
|
314
|
+
|
|
315
|
+
```bash
|
|
316
|
+
# will create a new major release.
|
|
317
|
+
breaking: change button color to red
|
|
318
|
+
feat!: add new button component
|
|
319
|
+
|
|
320
|
+
# will create a new minor release.
|
|
321
|
+
feat: add new button component
|
|
322
|
+
|
|
323
|
+
# will create a new patch release.
|
|
324
|
+
fix: fix button color
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
See default ruleset [here](https://github.com/semantic-release/commit-analyzer/blob/master/lib/default-release-rules.js)
|
|
328
|
+
|
|
329
|
+
# force-publish
|
|
@@ -76,23 +76,11 @@
|
|
|
76
76
|
|
|
77
77
|
{#if $internal}
|
|
78
78
|
<div class="flex flex-col w-full {!isValid ? `text-danger-500` : `text-surface-900`}">
|
|
79
|
-
<div class="flex space-x-3 relative
|
|
79
|
+
<div class="flex space-x-3 relative my-1 items-center">
|
|
80
|
+
<Checkbox id="input_{state_key}" name={state_key} bind:checked={$internal.checked} />
|
|
80
81
|
<Label for="input_{state_key}" class="block {hide_label ? 'hidden' : ''}">
|
|
81
82
|
{label}
|
|
82
83
|
</Label>
|
|
83
|
-
|
|
84
|
-
<Checkbox
|
|
85
|
-
on:keydown={(e) => {
|
|
86
|
-
if (e.key === "Enter") {
|
|
87
|
-
e.preventDefault();
|
|
88
|
-
}
|
|
89
|
-
}}
|
|
90
|
-
type="checkbox"
|
|
91
|
-
id="input_{state_key}"
|
|
92
|
-
placeholder={label}
|
|
93
|
-
name={state_key}
|
|
94
|
-
bind:checked={$internal.checked}
|
|
95
|
-
/>
|
|
96
84
|
</div>
|
|
97
85
|
{#if validationMessage}
|
|
98
86
|
<Label class={!isValid ? `text-danger-500` : `text-success-500`}>{validationMessage}</Label>
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { writable } from "svelte/store";
|
|
7
7
|
import { syncStoreToStore } from "../../utils/syncing";
|
|
8
8
|
|
|
9
|
+
import { scale } from "svelte/transition";
|
|
9
10
|
import { Label } from "@stubber/ui/label";
|
|
10
11
|
import { Button } from "@stubber/ui/button";
|
|
11
12
|
|
|
@@ -276,10 +277,10 @@
|
|
|
276
277
|
placeholder={label}
|
|
277
278
|
class="bg-gradient-to-b from-[#2727271F] to-[#27272719] shadow-select
|
|
278
279
|
flex h-7 w-full items-center justify-between rounded px-3 py-2
|
|
279
|
-
text-sm
|
|
280
|
+
text-sm focus:outline-none
|
|
280
281
|
[&>span]:line-clamp-1 aria-[invalid]:border-destructive
|
|
281
282
|
placeholder:text-black
|
|
282
|
-
{!isValid ? 'ring-danger-500' : 'ring-surface-300 focus:ring-
|
|
283
|
+
{!isValid ? 'ring-danger-500' : 'ring-surface-300 focus:ring-transparent'}"
|
|
283
284
|
bind:value={filter_text}
|
|
284
285
|
autocomplete="off"
|
|
285
286
|
/>
|
|
@@ -298,50 +299,52 @@
|
|
|
298
299
|
{/if}
|
|
299
300
|
</div>
|
|
300
301
|
{#if is_focused}
|
|
301
|
-
<div use:teleport class="z-10 w-full
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
<
|
|
343
|
-
|
|
344
|
-
|
|
302
|
+
<div use:teleport class="z-10 w-full inset-y-[70px] mt-1">
|
|
303
|
+
<div
|
|
304
|
+
transition:scale={{
|
|
305
|
+
start: 0.95,
|
|
306
|
+
opacity: 0,
|
|
307
|
+
duration: 50,
|
|
308
|
+
}}
|
|
309
|
+
class="bg-popover text-popover-foreground relative min-w-[8rem]
|
|
310
|
+
overflow-hidden rounded-md border shadow-md outline-none
|
|
311
|
+
max-h-[200px] overflow-y-auto w-full p-1"
|
|
312
|
+
>
|
|
313
|
+
{#if items?.length > 0}
|
|
314
|
+
<ul>
|
|
315
|
+
{#each items as item, index (item?._value?._key)}
|
|
316
|
+
<li class="group {$internal.focused_index === index ? 'bg-primary-400' : ''}">
|
|
317
|
+
<button
|
|
318
|
+
type="button"
|
|
319
|
+
on:click|preventDefault={() => setSelected(item)}
|
|
320
|
+
class="selectitem relative flex w-full cursor-default
|
|
321
|
+
select-none items-center rounded-sm py-1 pl-8 pr-2
|
|
322
|
+
text-sm outline-none hover:bg-accent
|
|
323
|
+
hover:text-accent-foreground
|
|
324
|
+
data-[highlighted]:bg-accent
|
|
325
|
+
data-[highlighted]:text-accent-foreground
|
|
326
|
+
data-[disabled]:pointer-events-none
|
|
327
|
+
data-[disabled]:opacity-50"
|
|
328
|
+
>
|
|
329
|
+
{item._label}
|
|
330
|
+
{#if item.is_personal}
|
|
331
|
+
<div class="mx-2 bg-surface-300 rounded-full text-xs p-0.5 px-2 text-white">
|
|
332
|
+
Import from personal
|
|
333
|
+
</div>
|
|
334
|
+
{/if}
|
|
335
|
+
{#if item?._value?._key == $internal?.selected_item?._value?._key}
|
|
336
|
+
<i class="absolute left-2 h-3.5 w-3.5 fa-regular fa-check" />
|
|
337
|
+
{/if}
|
|
338
|
+
</button>
|
|
339
|
+
</li>
|
|
340
|
+
{/each}
|
|
341
|
+
</ul>
|
|
342
|
+
{:else}
|
|
343
|
+
<div class="flex items-center justify-center py-4">
|
|
344
|
+
<span class="text-sm text-surface-400">Start typing to search...</span>
|
|
345
|
+
</div>
|
|
346
|
+
{/if}
|
|
347
|
+
</div>
|
|
345
348
|
</div>
|
|
346
349
|
{/if}
|
|
347
350
|
<div class="mt-1 ml-auto">
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import _ from "lodash-es";
|
|
3
3
|
|
|
4
|
+
import { Label } from "@stubber/ui/label";
|
|
5
|
+
|
|
4
6
|
export let field;
|
|
5
7
|
|
|
6
8
|
$: state_key = $field.state?.state_key;
|
|
@@ -12,13 +14,13 @@
|
|
|
12
14
|
$: value = !value_is_string ? JSON.stringify($field.data?.base, null, 2) : $field.data?.base;
|
|
13
15
|
</script>
|
|
14
16
|
|
|
15
|
-
<div class="flex flex-col w-full text-surface-900">
|
|
16
|
-
<
|
|
17
|
+
<div class="flex flex-col w-full text-surface-900 my-2">
|
|
18
|
+
<Label for="input_{state_key}" class="block {hide_label ? 'hidden' : ''}">
|
|
17
19
|
{label}
|
|
18
|
-
</
|
|
20
|
+
</Label>
|
|
19
21
|
<div class="relative mt-2 rounded-md">
|
|
20
22
|
<div
|
|
21
|
-
class="
|
|
23
|
+
class="bg-gradient-to-b from-[#2727271F] to-[#27272719] shadow-select flex items-center h-7 w-full rounded px-3 py-2 text-sm focus:outline-none placeholder:text-black"
|
|
22
24
|
>
|
|
23
25
|
{#if value_is_string}
|
|
24
26
|
{value}
|
|
@@ -27,9 +29,10 @@
|
|
|
27
29
|
{/if}
|
|
28
30
|
</div>
|
|
29
31
|
</div>
|
|
32
|
+
|
|
30
33
|
{#if validationMessage}
|
|
31
|
-
<
|
|
34
|
+
<Label class=" {!isValid ? `text-danger-500` : `text-success-500`}">
|
|
32
35
|
{validationMessage}
|
|
33
|
-
</
|
|
36
|
+
</Label>
|
|
34
37
|
{/if}
|
|
35
38
|
</div>
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
import { onMount } from "svelte";
|
|
6
6
|
import { writable } from "svelte/store";
|
|
7
7
|
|
|
8
|
+
import { Label } from "@stubber/ui/label";
|
|
9
|
+
|
|
8
10
|
export let field;
|
|
9
11
|
|
|
10
12
|
const internal = writable();
|
|
@@ -64,10 +66,10 @@
|
|
|
64
66
|
</script>
|
|
65
67
|
|
|
66
68
|
{#if $internal}
|
|
67
|
-
<div class="flex flex-col w-full text-surface-900">
|
|
68
|
-
<
|
|
69
|
+
<div class="flex flex-col w-full text-surface-900 my-2">
|
|
70
|
+
<Label for="input_{state_key}" class="block {hide_label ? 'hidden' : ''}">
|
|
69
71
|
{label}
|
|
70
|
-
</
|
|
72
|
+
</Label>
|
|
71
73
|
<div class="relative mt-2 rounded-md">
|
|
72
74
|
<input
|
|
73
75
|
on:keydown={(e) => {
|
|
@@ -78,17 +80,17 @@
|
|
|
78
80
|
type="date"
|
|
79
81
|
id="input_{state_key}"
|
|
80
82
|
placeholder={label}
|
|
81
|
-
class="
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
class="bg-gradient-to-b from-[#2727271F] to-[#27272719] shadow-select block h-7 w-full rounded px-3 py-2 text-sm focus:outline-none
|
|
84
|
+
placeholder:text-black
|
|
85
|
+
{!isValid ? 'ring-danger-500' : 'ring-surface-300 focus:ring-transparent'}"
|
|
84
86
|
name={state_key}
|
|
85
87
|
bind:value={$internal.raw}
|
|
86
88
|
/>
|
|
87
89
|
</div>
|
|
88
90
|
{#if validationMessage}
|
|
89
|
-
<
|
|
91
|
+
<Label class="text-label {!isValid ? `text-danger-500` : `text-success-500`}">
|
|
90
92
|
{validationMessage}
|
|
91
|
-
</
|
|
93
|
+
</Label>
|
|
92
94
|
{/if}
|
|
93
95
|
</div>
|
|
94
96
|
{/if}
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
import { onMount } from "svelte";
|
|
6
6
|
import { writable } from "svelte/store";
|
|
7
7
|
|
|
8
|
+
import { Label } from "@stubber/ui/label";
|
|
9
|
+
|
|
8
10
|
export let field;
|
|
9
11
|
|
|
10
12
|
const internal = writable();
|
|
@@ -64,10 +66,10 @@
|
|
|
64
66
|
</script>
|
|
65
67
|
|
|
66
68
|
{#if $internal}
|
|
67
|
-
<div class="flex flex-col w-full text-surface-900">
|
|
68
|
-
<
|
|
69
|
+
<div class="flex flex-col w-full text-surface-900 my-2">
|
|
70
|
+
<Label for="input_{state_key}" class="block {hide_label ? 'hidden' : ''}">
|
|
69
71
|
{label}
|
|
70
|
-
</
|
|
72
|
+
</Label>
|
|
71
73
|
<div class="relative mt-2 rounded-md">
|
|
72
74
|
<input
|
|
73
75
|
on:keydown={(e) => {
|
|
@@ -78,17 +80,17 @@
|
|
|
78
80
|
type="datetime-local"
|
|
79
81
|
id="input_{state_key}"
|
|
80
82
|
placeholder={label}
|
|
81
|
-
class="
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
class="bg-gradient-to-b from-[#2727271F] to-[#27272719] shadow-select block h-7 w-full rounded px-3 py-2 text-sm focus:outline-none
|
|
84
|
+
placeholder:text-black
|
|
85
|
+
{!isValid ? 'ring-danger-500' : 'ring-surface-300 focus:ring-transparent'}"
|
|
84
86
|
name={state_key}
|
|
85
87
|
bind:value={$internal.raw}
|
|
86
88
|
/>
|
|
87
89
|
</div>
|
|
88
90
|
{#if validationMessage}
|
|
89
|
-
<
|
|
91
|
+
<Label class={!isValid ? `text-danger-500` : `text-success-500`}>
|
|
90
92
|
{validationMessage}
|
|
91
|
-
</
|
|
93
|
+
</Label>
|
|
92
94
|
{/if}
|
|
93
95
|
</div>
|
|
94
96
|
{/if}
|
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
import { onMount } from "svelte";
|
|
6
6
|
import { writable } from "svelte/store";
|
|
7
7
|
|
|
8
|
+
import { Label } from "@stubber/ui/label";
|
|
9
|
+
import { Input } from "@stubber/ui/input";
|
|
10
|
+
|
|
8
11
|
export let field;
|
|
9
12
|
|
|
10
13
|
const internal = writable();
|
|
@@ -94,12 +97,12 @@
|
|
|
94
97
|
</script>
|
|
95
98
|
|
|
96
99
|
{#if $internal}
|
|
97
|
-
<div class="flex flex-col w-full text-surface-900">
|
|
98
|
-
<
|
|
100
|
+
<div class="flex flex-col w-full text-surface-900 my-2">
|
|
101
|
+
<Label for="input_{state_key}" class="block py-2 {hide_label ? 'hidden' : ''}">
|
|
99
102
|
{label}
|
|
100
|
-
</
|
|
103
|
+
</Label>
|
|
101
104
|
<div class="relative rounded-md">
|
|
102
|
-
<
|
|
105
|
+
<Input
|
|
103
106
|
on:keydown={(e) => {
|
|
104
107
|
if (e.key === "Enter") {
|
|
105
108
|
e.preventDefault();
|
|
@@ -108,7 +111,7 @@
|
|
|
108
111
|
type="text"
|
|
109
112
|
id="input_{state_key}"
|
|
110
113
|
placeholder={label}
|
|
111
|
-
class="block w-full
|
|
114
|
+
class="block w-full placeholder:opacity-30 {!isValid
|
|
112
115
|
? 'ring-danger-500'
|
|
113
116
|
: 'ring-surface-300 focus:ring-primary-400'} focus:outline-none placeholder:text-surface-400 focus:ring-2 focus:ring-inset"
|
|
114
117
|
name={state_key}
|
|
@@ -116,9 +119,9 @@
|
|
|
116
119
|
/>
|
|
117
120
|
</div>
|
|
118
121
|
{#if validationMessage}
|
|
119
|
-
<
|
|
122
|
+
<Label class=" {!isValid ? `text-danger-500` : `text-success-500`}">
|
|
120
123
|
{validationMessage}
|
|
121
|
-
</
|
|
124
|
+
</Label>
|
|
122
125
|
{/if}
|
|
123
126
|
</div>
|
|
124
127
|
{/if}
|
|
@@ -213,7 +213,7 @@
|
|
|
213
213
|
});
|
|
214
214
|
</script>
|
|
215
215
|
|
|
216
|
-
<div class="flex flex-col w-full text-surface-900">
|
|
216
|
+
<div class="flex flex-col w-full text-surface-900 my-2">
|
|
217
217
|
<Label for="input_{state_key}" class="block text-label {hide_label ? 'hidden' : ''}">
|
|
218
218
|
{label}
|
|
219
219
|
</Label>
|
|
@@ -109,10 +109,10 @@
|
|
|
109
109
|
});
|
|
110
110
|
</script>
|
|
111
111
|
|
|
112
|
-
<div class="flex flex-col w-full text-surface-900">
|
|
113
|
-
<
|
|
112
|
+
<div class="flex flex-col w-full text-surface-900 my-2">
|
|
113
|
+
<Label for="input_{state_key}" class="block {hide_label ? 'hidden' : ''}">
|
|
114
114
|
{label}
|
|
115
|
-
</
|
|
115
|
+
</Label>
|
|
116
116
|
{#if initial_form}
|
|
117
117
|
<Form bind:form={settings_form} {initial_form} {dependencies} />
|
|
118
118
|
{/if}
|
|
@@ -166,10 +166,7 @@
|
|
|
166
166
|
</script>
|
|
167
167
|
|
|
168
168
|
{#if $internal}
|
|
169
|
-
<Label
|
|
170
|
-
for="input_{state_key}"
|
|
171
|
-
class="block text-label text-surface-900 {hide_label ? 'hidden' : ''}"
|
|
172
|
-
>
|
|
169
|
+
<Label for="input_{state_key}" class="block py-2 text-surface-900 {hide_label ? 'hidden' : ''}">
|
|
173
170
|
{label}
|
|
174
171
|
</Label>
|
|
175
172
|
<div class="w-full flex flex-col {!isValid ? 'border-b border-warning-500' : ''}">
|
|
@@ -78,10 +78,10 @@
|
|
|
78
78
|
</script>
|
|
79
79
|
|
|
80
80
|
{#if $internal && $internal}
|
|
81
|
-
<div class="flex flex-col w-full text-surface-900 jse-theme-dark">
|
|
82
|
-
<
|
|
81
|
+
<div class="flex flex-col w-full text-surface-900 my-2 jse-theme-dark">
|
|
82
|
+
<Label for="input_{state_key}" class="block {hide_label ? 'hidden' : ''}">
|
|
83
83
|
{label}
|
|
84
|
-
</
|
|
84
|
+
</Label>
|
|
85
85
|
<JSONEditor bind:content={$internal.content} {readOnly} bind:mode={$internal.mode} />
|
|
86
86
|
{#if validationMessage}
|
|
87
87
|
<Label class={!isValid ? `text-danger-500` : `text-success-500`}>{validationMessage}</Label>
|
|
@@ -127,11 +127,6 @@
|
|
|
127
127
|
border-radius: 10px !important;
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
:global(.jse-contents) {
|
|
131
|
-
background-color: #efeff0 !important;
|
|
132
|
-
border-radius: 0px !important;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
130
|
:global(.jse-navigation-bar) {
|
|
136
131
|
border-radius: 0px !important;
|
|
137
132
|
}
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
</script>
|
|
128
128
|
|
|
129
129
|
{#if $internal}
|
|
130
|
-
<div class="flex flex-col w-full text-surface-900">
|
|
130
|
+
<div class="flex flex-col w-full text-surface-900 my-2">
|
|
131
131
|
<label for="input_{state_key}" class="block text-label {hide_label ? 'hidden' : ''}">
|
|
132
132
|
{label}
|
|
133
133
|
</label>
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
</script>
|
|
67
67
|
|
|
68
68
|
{#if $internal}
|
|
69
|
-
<div class="flex flex-col w-full text-surface-900">
|
|
69
|
+
<div class="flex flex-col w-full text-surface-900 my-2">
|
|
70
70
|
<Label for="input_{state_key}" class=" {hide_label ? 'hidden' : ''}">
|
|
71
71
|
{label}
|
|
72
72
|
</Label>
|
|
@@ -80,7 +80,9 @@
|
|
|
80
80
|
rows="3"
|
|
81
81
|
id="input_{state_key}"
|
|
82
82
|
placeholder={label}
|
|
83
|
-
class="block w-full {!isValid
|
|
83
|
+
class="block w-full placeholder:opacity-30 {!isValid
|
|
84
|
+
? 'ring-danger-500'
|
|
85
|
+
: 'ring-surface-300 '} "
|
|
84
86
|
name={state_key}
|
|
85
87
|
bind:value={$internal.raw}
|
|
86
88
|
/>
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { writable } from "svelte/store";
|
|
7
7
|
|
|
8
8
|
import { Label } from "@stubber/ui/label";
|
|
9
|
+
import { Input } from "@stubber/ui/input";
|
|
9
10
|
|
|
10
11
|
export let field;
|
|
11
12
|
|
|
@@ -87,12 +88,12 @@
|
|
|
87
88
|
</script>
|
|
88
89
|
|
|
89
90
|
{#if $internal}
|
|
90
|
-
<div class="flex flex-col w-full text-surface-900">
|
|
91
|
-
<
|
|
91
|
+
<div class="flex flex-col w-full text-surface-900 my-2">
|
|
92
|
+
<Label for="input_{state_key}" class="block py-2{hide_label ? 'hidden' : ''}">
|
|
92
93
|
{label}
|
|
93
|
-
</
|
|
94
|
+
</Label>
|
|
94
95
|
<div class="relative rounded-md">
|
|
95
|
-
<
|
|
96
|
+
<Input
|
|
96
97
|
on:keydown={(e) => {
|
|
97
98
|
if (e.key === "Enter") {
|
|
98
99
|
e.preventDefault();
|
|
@@ -101,9 +102,9 @@
|
|
|
101
102
|
type="number"
|
|
102
103
|
id="input_{state_key}"
|
|
103
104
|
placeholder={label}
|
|
104
|
-
class="block w-full
|
|
105
|
+
class="block w-full placeholder:opacity-30 {!isValid
|
|
105
106
|
? 'ring-danger-500'
|
|
106
|
-
: 'ring-surface-300 focus:ring-primary-400'}
|
|
107
|
+
: 'ring-surface-300 focus:ring-primary-400'} "
|
|
107
108
|
name={state_key}
|
|
108
109
|
min={min_setting}
|
|
109
110
|
max={max_setting}
|
|
@@ -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
|
|
|
@@ -137,16 +139,16 @@
|
|
|
137
139
|
});
|
|
138
140
|
</script>
|
|
139
141
|
|
|
140
|
-
<div class="flex flex-col w-full text-surface-900">
|
|
141
|
-
<
|
|
142
|
+
<div class="flex flex-col w-full text-surface-900 my-2">
|
|
143
|
+
<Label for="input_{state_key}" class="block {hide_label ? 'hidden' : ''}">
|
|
142
144
|
{label}
|
|
143
|
-
</
|
|
145
|
+
</Label>
|
|
144
146
|
{#if initial_form}
|
|
145
147
|
<Form bind:form={settings_form} {initial_form} {dependencies} />
|
|
146
148
|
{/if}
|
|
147
149
|
{#if validationMessage}
|
|
148
|
-
<
|
|
150
|
+
<Label class=" {!isValid ? `text-danger-500` : `text-success-500`}">
|
|
149
151
|
{validationMessage}
|
|
150
|
-
</
|
|
152
|
+
</Label>
|
|
151
153
|
{/if}
|
|
152
154
|
</div>
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
import { Html5Qrcode } from "html5-qrcode";
|
|
9
9
|
import { Button } from "@stubber/ui/button";
|
|
10
10
|
|
|
11
|
+
import { Label } from "@stubber/ui/label";
|
|
12
|
+
|
|
11
13
|
export let field;
|
|
12
14
|
|
|
13
15
|
const internal = writable();
|
|
@@ -162,9 +164,9 @@
|
|
|
162
164
|
{/if}
|
|
163
165
|
|
|
164
166
|
<div class="flex flex-col w-full text-surface-900">
|
|
165
|
-
<
|
|
167
|
+
<Label for="input_{state_key}" class="block {hide_label ? 'hidden' : ''}">
|
|
166
168
|
{label}
|
|
167
|
-
</
|
|
169
|
+
</Label>
|
|
168
170
|
<div class="relative mt-2 rounded-md">
|
|
169
171
|
<div class="flex items-center space-x-3">
|
|
170
172
|
{#if $internal.raw}
|
|
@@ -85,15 +85,15 @@
|
|
|
85
85
|
</script>
|
|
86
86
|
|
|
87
87
|
{#if $internal}
|
|
88
|
-
<div class="flex flex-col w-full text-surface-900">
|
|
89
|
-
<Label for="input_{state_key}" class=" {hide_label ? 'hidden' : ''}">
|
|
88
|
+
<div class="flex flex-col w-full text-surface-900 my-2">
|
|
89
|
+
<Label for="input_{state_key}" class=" block py-2 {hide_label ? 'hidden' : ''}">
|
|
90
90
|
{label}
|
|
91
91
|
</Label>
|
|
92
92
|
{#if items?.length}
|
|
93
93
|
<fieldset
|
|
94
94
|
class="flex flex-col border {!isValid
|
|
95
95
|
? 'border-warning-500'
|
|
96
|
-
: 'border-surface-
|
|
96
|
+
: 'border-surface-100'} rounded-md px-2 py-1"
|
|
97
97
|
id="input_{state_key}"
|
|
98
98
|
>
|
|
99
99
|
{#each items as item}
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
import { writable } from "svelte/store";
|
|
7
7
|
import { syncStoreToStore } from "../../utils/syncing";
|
|
8
8
|
|
|
9
|
+
import { Label } from "@stubber/ui/label";
|
|
10
|
+
|
|
9
11
|
export let form;
|
|
10
12
|
export let field;
|
|
11
13
|
|
|
@@ -210,9 +212,9 @@
|
|
|
210
212
|
|
|
211
213
|
{#if $internal}
|
|
212
214
|
<div class="flex flex-col w-full text-surface-900">
|
|
213
|
-
<
|
|
215
|
+
<Label for="input_{state_key}" class="block py-2 {hide_label ? 'hidden' : ''}">
|
|
214
216
|
{label}
|
|
215
|
-
</
|
|
217
|
+
</Label>
|
|
216
218
|
<div>
|
|
217
219
|
<Button variant={isRecording ? "destructive" : "default"} on:click={toggleRecording}>
|
|
218
220
|
{#if isRecording}
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
import { writable } from "svelte/store";
|
|
7
7
|
import { syncStoreToStore } from "../../utils/syncing";
|
|
8
8
|
|
|
9
|
+
import { Label } from "@stubber/ui/label";
|
|
10
|
+
|
|
9
11
|
export let form;
|
|
10
12
|
export let field;
|
|
11
13
|
|
|
@@ -212,9 +214,9 @@
|
|
|
212
214
|
|
|
213
215
|
{#if $internal}
|
|
214
216
|
<div class="flex flex-col w-full text-surface-900">
|
|
215
|
-
<
|
|
217
|
+
<Label for="input_{state_key}" class="block py-2 {hide_label ? 'hidden' : ''}">
|
|
216
218
|
{label}
|
|
217
|
-
</
|
|
219
|
+
</Label>
|
|
218
220
|
<div>
|
|
219
221
|
<Button variant={isRecording ? "destructive" : "default"} on:click={toggleRecording}>
|
|
220
222
|
{#if isRecording}
|
|
@@ -82,11 +82,11 @@
|
|
|
82
82
|
</script>
|
|
83
83
|
|
|
84
84
|
{#if $internal}
|
|
85
|
-
<div class="flex flex-col w-full text-surface-900">
|
|
85
|
+
<div class="flex flex-col w-full text-surface-900 my-2">
|
|
86
86
|
<!-- div with inner shadow -->
|
|
87
87
|
<div
|
|
88
88
|
bind:this={outer}
|
|
89
|
-
class="border max-h-[300px] overflow-y-scroll shadow-inner"
|
|
89
|
+
class="border max-h-[300px] overflow-y-scroll shadow-inner rounded-md"
|
|
90
90
|
on:scroll={handleScroll}
|
|
91
91
|
>
|
|
92
92
|
<div class="p-6 px-2">
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import * as utils from "../../utils/index.js";
|
|
8
8
|
|
|
9
9
|
import { Label } from "@stubber/ui/label";
|
|
10
|
+
import { scale } from "svelte/transition";
|
|
10
11
|
|
|
11
12
|
export let field;
|
|
12
13
|
|
|
@@ -150,11 +151,11 @@
|
|
|
150
151
|
filter_text = $field?.data?.base_label ?? "";
|
|
151
152
|
}
|
|
152
153
|
}}
|
|
153
|
-
class="relative flex flex-col w-full text-surface-900"
|
|
154
|
+
class="relative flex flex-col w-full text-surface-900 my-2"
|
|
154
155
|
>
|
|
155
|
-
<
|
|
156
|
+
<Label for="input_{state_key}" class="block py-2{hide_label ? 'hidden' : ''}">
|
|
156
157
|
{label}
|
|
157
|
-
</
|
|
158
|
+
</Label>
|
|
158
159
|
<div class="relative flex rounded-md">
|
|
159
160
|
<input
|
|
160
161
|
on:keydown={(e) => {
|
|
@@ -187,10 +188,10 @@
|
|
|
187
188
|
placeholder={label}
|
|
188
189
|
class="bg-gradient-to-b from-[#2727271F] to-[#27272719] shadow-select
|
|
189
190
|
flex h-7 w-full items-center justify-between rounded px-3 py-2
|
|
190
|
-
text-sm
|
|
191
|
+
text-sm focus:outline-none
|
|
191
192
|
[&>span]:line-clamp-1 aria-[invalid]:border-destructive
|
|
192
193
|
placeholder:text-black
|
|
193
|
-
{!isValid ? 'ring-danger-500' : 'ring-surface-300 focus:ring-
|
|
194
|
+
{!isValid ? 'ring-danger-500' : 'ring-surface-300 focus:ring-transparent'}"
|
|
194
195
|
name={state_key}
|
|
195
196
|
bind:value={filter_text}
|
|
196
197
|
autocomplete="off"
|
|
@@ -200,34 +201,49 @@
|
|
|
200
201
|
</div>
|
|
201
202
|
</div>
|
|
202
203
|
{#if is_focused}
|
|
203
|
-
<div use:teleport class="z-10 w-full inset-y-[70px]">
|
|
204
|
-
<
|
|
204
|
+
<div use:teleport class="z-10 w-full inset-y-[70px] mt-1">
|
|
205
|
+
<div
|
|
206
|
+
transition:scale={{
|
|
207
|
+
start: 0.95,
|
|
208
|
+
opacity: 0,
|
|
209
|
+
duration: 50,
|
|
210
|
+
}}
|
|
205
211
|
class="bg-popover text-popover-foreground relative min-w-[8rem]
|
|
206
|
-
|
|
207
|
-
|
|
212
|
+
overflow-hidden rounded-md border shadow-md outline-none
|
|
213
|
+
max-h-[200px] overflow-y-auto w-full p-1"
|
|
208
214
|
>
|
|
209
|
-
{#
|
|
210
|
-
<
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
215
|
+
{#if filteritems.length > 0}
|
|
216
|
+
<ul>
|
|
217
|
+
{#each filteritems as item, index (item._key)}
|
|
218
|
+
<li class="group {$internal.focused_index === index ? 'bg-primary-400' : ''} ">
|
|
219
|
+
<button
|
|
220
|
+
type="button"
|
|
221
|
+
on:click|preventDefault={() => setSelected(item)}
|
|
222
|
+
class="selectitem relative flex w-full cursor-default
|
|
223
|
+
select-none items-center rounded-sm py-1 pl-8 pr-2
|
|
224
|
+
text-sm outline-none hover:bg-accent
|
|
225
|
+
hover:text-accent-foreground
|
|
226
|
+
data-[highlighted]:bg-accent
|
|
227
|
+
data-[highlighted]:text-accent-foreground
|
|
228
|
+
data-[disabled]:pointer-events-none
|
|
229
|
+
data-[disabled]:opacity-50"
|
|
230
|
+
>
|
|
231
|
+
{item._label}
|
|
232
|
+
{#if item._key === $internal?.selected_item_key}
|
|
233
|
+
<i class="absolute left-2 h-3.5 w-3.5 fa-regular fa-check" />
|
|
234
|
+
{/if}
|
|
235
|
+
</button>
|
|
236
|
+
</li>
|
|
237
|
+
{/each}
|
|
238
|
+
</ul>
|
|
239
|
+
{:else}
|
|
240
|
+
<div class="flex items-center justify-center py-4">
|
|
241
|
+
<span class="text-sm text-surface-400">
|
|
242
|
+
{filter_text ? "No results found" : "Start typing to search..."}
|
|
243
|
+
</span>
|
|
244
|
+
</div>
|
|
245
|
+
{/if}
|
|
246
|
+
</div>
|
|
231
247
|
</div>
|
|
232
248
|
{/if}
|
|
233
249
|
{#if validationMessage}
|
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
import { writable } from "svelte/store";
|
|
7
7
|
import { syncStoreToStore } from "../../utils/syncing";
|
|
8
8
|
|
|
9
|
+
import { scale } from "svelte/transition";
|
|
10
|
+
import { Label } from "@stubber/ui/label";
|
|
11
|
+
|
|
9
12
|
export let form;
|
|
10
13
|
export let field;
|
|
11
14
|
|
|
@@ -196,9 +199,9 @@
|
|
|
196
199
|
}}
|
|
197
200
|
class="relative flex flex-col w-full text-surface-900"
|
|
198
201
|
>
|
|
199
|
-
<
|
|
202
|
+
<Label for="input_{state_key}" class="block {hide_label ? 'hidden' : ''}">
|
|
200
203
|
{label}
|
|
201
|
-
</
|
|
204
|
+
</Label>
|
|
202
205
|
<div class="relative flex mt-2 rounded-md">
|
|
203
206
|
<input
|
|
204
207
|
on:keydown={(e) => {
|
|
@@ -229,9 +232,12 @@
|
|
|
229
232
|
type="select"
|
|
230
233
|
id="input_mask{state_key}"
|
|
231
234
|
placeholder={label}
|
|
232
|
-
class="
|
|
233
|
-
|
|
234
|
-
|
|
235
|
+
class="bg-gradient-to-b from-[#2727271F] to-[#27272719] shadow-select
|
|
236
|
+
flex h-7 w-full items-center justify-between rounded px-3 py-2
|
|
237
|
+
text-sm focus:outline-none
|
|
238
|
+
[&>span]:line-clamp-1 aria-[invalid]:border-destructive
|
|
239
|
+
placeholder:text-black
|
|
240
|
+
{!isValid ? 'ring-danger-500' : 'ring-surface-300 focus:ring-transparent'}"
|
|
235
241
|
bind:value={filter_text}
|
|
236
242
|
autocomplete="off"
|
|
237
243
|
/>
|
|
@@ -250,42 +256,53 @@
|
|
|
250
256
|
{/if}
|
|
251
257
|
</div>
|
|
252
258
|
{#if is_focused}
|
|
253
|
-
<div use:teleport class="z-10 w-full
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
>
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
259
|
+
<div use:teleport class="z-10 w-full inset-y-[70px] mt-1">
|
|
260
|
+
<div
|
|
261
|
+
transition:scale={{
|
|
262
|
+
start: 0.95,
|
|
263
|
+
opacity: 0,
|
|
264
|
+
duration: 50,
|
|
265
|
+
}}
|
|
266
|
+
class="bg-popover text-popover-foreground relative min-w-[8rem]
|
|
267
|
+
overflow-hidden rounded-md border shadow-md outline-none
|
|
268
|
+
max-h-[200px] overflow-y-auto w-full p-1"
|
|
269
|
+
>
|
|
270
|
+
{#if items?.length > 0}
|
|
271
|
+
<ul>
|
|
272
|
+
{#each items as item, index (item?._value?._key)}
|
|
273
|
+
<li class="group {$internal.focused_index === index ? 'bg-primary-400' : ''}">
|
|
274
|
+
<button
|
|
275
|
+
type="button"
|
|
276
|
+
on:click|preventDefault={() => setSelected(item)}
|
|
277
|
+
class="selectitem relative flex w-full cursor-default
|
|
278
|
+
select-none items-center rounded-sm py-1 pl-8 pr-2
|
|
279
|
+
text-sm outline-none hover:bg-accent
|
|
280
|
+
hover:text-accent-foreground
|
|
281
|
+
data-[highlighted]:bg-accent
|
|
282
|
+
data-[highlighted]:text-accent-foreground
|
|
283
|
+
data-[disabled]:pointer-events-none
|
|
284
|
+
data-[disabled]:opacity-50"
|
|
285
|
+
>
|
|
286
|
+
{item._label}
|
|
287
|
+
{#if item?._value?._key == $internal?.selected_item?._value?._key}
|
|
288
|
+
<i class="absolute left-2 h-3.5 w-3.5 fa-regular fa-check" />
|
|
289
|
+
{/if}
|
|
290
|
+
</button>
|
|
291
|
+
</li>
|
|
292
|
+
{/each}
|
|
293
|
+
</ul>
|
|
294
|
+
{:else}
|
|
295
|
+
<div class="flex items-center justify-center py-4">
|
|
296
|
+
<span class="text-sm text-surface-400">Start typing to search...</span>
|
|
297
|
+
</div>
|
|
298
|
+
{/if}
|
|
299
|
+
</div>
|
|
283
300
|
</div>
|
|
284
301
|
{/if}
|
|
285
302
|
{#if validationMessage}
|
|
286
|
-
<
|
|
303
|
+
<Label class=" {!isValid ? `text-danger-500` : `text-success-500`}">
|
|
287
304
|
{validationMessage}
|
|
288
|
-
</
|
|
305
|
+
</Label>
|
|
289
306
|
{/if}
|
|
290
307
|
</div>
|
|
291
308
|
{/if}
|
|
@@ -248,13 +248,13 @@
|
|
|
248
248
|
</script>
|
|
249
249
|
|
|
250
250
|
{#if $internal && is_string}
|
|
251
|
-
<div class="flex flex-col w-full text-surface-900">
|
|
252
|
-
<Label for="input_{state_key}" class="block{hide_label ? 'hidden' : ''}">
|
|
251
|
+
<div class="flex flex-col w-full text-surface-900 my-2">
|
|
252
|
+
<Label for="input_{state_key}" class="block py-2 {hide_label ? 'hidden' : ''}">
|
|
253
253
|
{label}
|
|
254
254
|
</Label>
|
|
255
255
|
<div
|
|
256
256
|
bind:this={editor_parent}
|
|
257
|
-
class="stubber-cm text-
|
|
257
|
+
class=" stubber-cm text-sm {isValid ? 'stubber-valid' : 'stubber-invalid'}"
|
|
258
258
|
/>
|
|
259
259
|
{#if validationMessage}
|
|
260
260
|
<Label class="text-label {!isValid ? `text-danger-500` : `text-success-500`}">
|
|
@@ -273,41 +273,32 @@
|
|
|
273
273
|
|
|
274
274
|
<style>
|
|
275
275
|
.stubber-cm :global(.cm-editor) {
|
|
276
|
-
/*
|
|
276
|
+
/* Base styles */
|
|
277
|
+
background-color: rgba(255, 255, 255, 0.85);
|
|
277
278
|
border-radius: 0.375rem;
|
|
278
|
-
border-
|
|
279
|
+
--tw-border-opacity: 1;
|
|
280
|
+
border-color: hsl(var(--input) / var(--tw-border-opacity, 1));
|
|
281
|
+
border-width: 1px;
|
|
282
|
+
border-style: solid;
|
|
283
|
+
width: 100%;
|
|
279
284
|
color: rgb(31 41 51);
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
var(--tw-ring-color);
|
|
284
|
-
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
|
|
285
|
-
--tw-ring-inset: inset;
|
|
286
|
-
--tw-ring-opacity: 1;
|
|
287
|
-
--tw-ring-color: rgb(188 191 194 / var(--tw-ring-opacity));
|
|
288
|
-
background-color: white;
|
|
285
|
+
|
|
286
|
+
/* Top inset shadow only */
|
|
287
|
+
box-shadow: inset 0px 16px 16px -16px rgba(0, 0, 0, 0.1333);
|
|
289
288
|
}
|
|
290
289
|
|
|
291
290
|
.stubber-cm :global(.cm-editor.cm-focused) {
|
|
292
291
|
outline: none;
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
var(--tw-ring-offset-color);
|
|
296
|
-
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width))
|
|
297
|
-
var(--tw-ring-color);
|
|
298
|
-
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
|
|
292
|
+
border-width: 1px;
|
|
293
|
+
border-color: var(--ring);
|
|
299
294
|
}
|
|
300
295
|
|
|
301
296
|
.stubber-cm.stubber-valid :global(.cm-editor.cm-focused) {
|
|
302
|
-
|
|
303
|
-
--tw-ring-opacity: 1;
|
|
304
|
-
--tw-ring-color: rgb(33 134 235 / var(--tw-ring-opacity));
|
|
297
|
+
border-color: rgb(170, 170, 170, 0.5);
|
|
305
298
|
}
|
|
306
299
|
|
|
307
300
|
.stubber-cm.stubber-invalid :global(.cm-editor) {
|
|
308
|
-
|
|
309
|
-
--tw-ring-opacity: 1;
|
|
310
|
-
--tw-ring-color: rgb(225 45 57 / var(--tw-ring-opacity));
|
|
301
|
+
border-color: rgb(225 45 57);
|
|
311
302
|
}
|
|
312
303
|
|
|
313
304
|
.stubber-cm :global(.cm-editor .cm-scroller) {
|
|
@@ -317,26 +308,28 @@
|
|
|
317
308
|
|
|
318
309
|
.stubber-cm :global(.cm-editor .cm-content) {
|
|
319
310
|
padding: 0;
|
|
320
|
-
|
|
321
|
-
padding-
|
|
322
|
-
padding-bottom: 8px;
|
|
311
|
+
padding-top: 0.5rem;
|
|
312
|
+
padding-bottom: 0.5rem;
|
|
323
313
|
}
|
|
324
314
|
|
|
325
315
|
.stubber-cm :global(.cm-editor .cm-line) {
|
|
326
316
|
padding: 0;
|
|
327
|
-
|
|
328
|
-
padding-left: 12px;
|
|
317
|
+
padding-left: 0.75rem;
|
|
329
318
|
}
|
|
330
319
|
|
|
331
320
|
.stubber-cm :global(.cm-editor .cm-placeholder) {
|
|
332
|
-
|
|
333
|
-
--tw-text-opacity: 1;
|
|
334
|
-
color: rgb(165 169 173 / var(--tw-text-opacity));
|
|
321
|
+
color: var(--muted-foreground, rgb(165 169 173));
|
|
335
322
|
}
|
|
336
323
|
|
|
337
324
|
.stubber-cm :global(.curly-braces-highlight) {
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
325
|
+
color: rgb(9 103 210);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
/* CSS Custom Properties */
|
|
329
|
+
:root {
|
|
330
|
+
--ring: rgb(98, 98, 98);
|
|
331
|
+
--muted-foreground: rgb(165 169 173);
|
|
332
|
+
--input: 214.3 31.8% 91.4%;
|
|
333
|
+
--border: 214.3 31.8% 91.4%;
|
|
341
334
|
}
|
|
342
335
|
</style>
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
</script>
|
|
130
130
|
|
|
131
131
|
{#if $internal}
|
|
132
|
-
<div class="flex flex-col w-full text-surface-900">
|
|
132
|
+
<div class="flex flex-col w-full text-surface-900 my-2">
|
|
133
133
|
<Label for="input_{state_key}" class="block {hide_label ? 'hidden' : ''}">
|
|
134
134
|
{label}
|
|
135
135
|
</Label>
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
</script>
|
|
80
80
|
|
|
81
81
|
{#if $internal}
|
|
82
|
-
<div class="flex flex-col w-full
|
|
82
|
+
<div class="flex flex-col w-full my-2">
|
|
83
83
|
<Label for="input_{state_key}" class="block py-2 {hide_label ? 'hidden' : ''}">
|
|
84
84
|
{label}
|
|
85
85
|
</Label>
|
|
@@ -93,7 +93,9 @@
|
|
|
93
93
|
type="text"
|
|
94
94
|
id="input_{state_key}"
|
|
95
95
|
placeholder={label}
|
|
96
|
-
class="block w-full
|
|
96
|
+
class="block w-full placeholder:opacity-30 {!isValid
|
|
97
|
+
? 'ring-danger-500'
|
|
98
|
+
: 'ring-surface-300 '} "
|
|
97
99
|
name={state_key}
|
|
98
100
|
bind:value={$internal.raw}
|
|
99
101
|
/>
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
import { writable } from "svelte/store";
|
|
7
7
|
import { syncStoreToStore } from "../../utils/syncing";
|
|
8
8
|
|
|
9
|
+
import { Label } from "@stubber/ui/label";
|
|
10
|
+
|
|
9
11
|
export let form;
|
|
10
12
|
export let field;
|
|
11
13
|
|
|
@@ -204,9 +206,9 @@
|
|
|
204
206
|
|
|
205
207
|
{#if $internal}
|
|
206
208
|
<div class="flex flex-col w-full text-surface-900">
|
|
207
|
-
<
|
|
209
|
+
<Label for="input_{state_key}" class="block py-2 {hide_label ? 'hidden' : ''}">
|
|
208
210
|
{label}
|
|
209
|
-
</
|
|
211
|
+
</Label>
|
|
210
212
|
<div>
|
|
211
213
|
<Button variant={isRecording ? "destructive" : "default"} on:click={toggleRecording}>
|
|
212
214
|
{#if isRecording}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stubber/form-fields",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "An automatic form builder based on field specifications",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"components",
|
|
@@ -85,5 +85,15 @@
|
|
|
85
85
|
"svelte-preprocess",
|
|
86
86
|
"@parcel/watcher"
|
|
87
87
|
]
|
|
88
|
+
},
|
|
89
|
+
"release": {
|
|
90
|
+
"branches": [
|
|
91
|
+
"master"
|
|
92
|
+
],
|
|
93
|
+
"plugins": [
|
|
94
|
+
"@semantic-release/commit-analyzer",
|
|
95
|
+
"@semantic-release/release-notes-generator",
|
|
96
|
+
"@semantic-release/npm"
|
|
97
|
+
]
|
|
88
98
|
}
|
|
89
99
|
}
|