@stubber/form-fields 1.0.8 → 1.0.11

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 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
- - `npm version patch` to bump the version
310
- - `git push origin master` to push the bumped version
311
- - `npm run build` to build the package
312
- - `npm run package` to package the package
313
- - `npm publish` to publish the package
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
@@ -77,19 +77,7 @@
77
77
  {#if $internal}
78
78
  <div class="flex flex-col w-full {!isValid ? `text-danger-500` : `text-surface-900`}">
79
79
  <div class="flex space-x-3 relative my-1 items-center">
80
- <Checkbox
81
- on:keydown={(e) => {
82
- if (e.key === "Enter") {
83
- e.preventDefault();
84
- }
85
- }}
86
- type="checkbox"
87
- id="input_{state_key}"
88
- placeholder={label}
89
- name={state_key}
90
- bind:checked={$internal.checked}
91
- />
92
-
80
+ <Checkbox id="input_{state_key}" name={state_key} bind:checked={$internal.checked} />
93
81
  <Label for="input_{state_key}" class="block {hide_label ? 'hidden' : ''}">
94
82
  {label}
95
83
  </Label>
@@ -279,7 +279,7 @@
279
279
  flex h-7 w-full items-center justify-between rounded px-3 py-2
280
280
  text-sm focus:outline-none
281
281
  [&>span]:line-clamp-1 aria-[invalid]:border-destructive
282
- placeholder:text-black
282
+ placeholder:text-muted-foreground
283
283
  {!isValid ? 'ring-danger-500' : 'ring-surface-300 focus:ring-transparent'}"
284
284
  bind:value={filter_text}
285
285
  autocomplete="off"
@@ -183,12 +183,13 @@
183
183
  {label}
184
184
  </Label>
185
185
  <div
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
187
- ? 'ring-danger-500'
188
- : 'ring-surface-300 focus:ring-primary-400'} "
186
+ class="w-full flex items-center gap-2 border-input bg-white bg-opacity-[15] ring-offset-background placeholder:text-muted-foreground focus-within:ring-ring h-10 rounded-md border px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 {!isValid
187
+ ? 'focus-within:ring-danger-500'
188
+ : 'ring-surface-300'}"
189
+ style="box-shadow: inset 0px 16px 16px -16px rgba(0, 0, 0, 0.1333);"
189
190
  >
190
- <div class="pointer-events-none flex items-center pl-3">
191
- <span class="text-label text-surface-600">
191
+ <div class="pointer-events-none flex items-center pl-2">
192
+ <span class="text-sm text-surface-600">
192
193
  {getSymbolFromCurrency($internal?.currencycode)}
193
194
  </span>
194
195
  </div>
@@ -198,10 +199,10 @@
198
199
  e.preventDefault();
199
200
  }
200
201
  }}
202
+ class="w-full focus-within:outline-none"
201
203
  use:inputRegexMask={currencyRegex}
202
204
  id="input_{state_key}"
203
205
  placeholder={label}
204
- class="bg-transparent w-full focus:outline-none text-surface-900 placeholder:text-surface-400 ml-2"
205
206
  name={state_key}
206
207
  inputmode="decimal"
207
208
  bind:value={$internal.raw}
@@ -2,6 +2,7 @@
2
2
  import _ from "lodash-es";
3
3
 
4
4
  import { Label } from "@stubber/ui/label";
5
+ import { Input } from "@stubber/ui/input";
5
6
 
6
7
  export let field;
7
8
 
@@ -18,16 +19,8 @@
18
19
  <Label for="input_{state_key}" class="block {hide_label ? 'hidden' : ''}">
19
20
  {label}
20
21
  </Label>
21
- <div class="relative mt-2 rounded-md">
22
- <div
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"
24
- >
25
- {#if value_is_string}
26
- {value}
27
- {:else}
28
- <pre>{value}</pre>
29
- {/if}
30
- </div>
22
+ <div class="relative mt-2 rounded-md bg-surface-100 p-2">
23
+ <pre class="rounded-md">{value}</pre>
31
24
  </div>
32
25
 
33
26
  {#if validationMessage}
@@ -80,9 +80,10 @@
80
80
  type="date"
81
81
  id="input_{state_key}"
82
82
  placeholder={label}
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'}"
83
+ class="block w-full border-input bg-white bg-opacity-[15] ring-0 ring-offset-background focus-visible:ring-ring h-10 rounded-md border px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50
84
+ {!isValid ? 'ring-danger-500' : 'ring-surface-300'}
85
+ {$internal?.raw ? 'text-surface-900' : 'text-muted-foreground'}"
86
+ style="box-shadow: inset 0px 16px 16px -16px rgba(0, 0, 0, 0.1333);"
86
87
  name={state_key}
87
88
  bind:value={$internal.raw}
88
89
  />
@@ -80,9 +80,10 @@
80
80
  type="datetime-local"
81
81
  id="input_{state_key}"
82
82
  placeholder={label}
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'}"
83
+ class="block w-full border-input bg-white bg-opacity-[15] ring-0 ring-offset-background focus-visible:ring-ring h-10 rounded-md border px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50
84
+ {!isValid ? 'ring-danger-500' : 'ring-surface-300'}
85
+ {$internal?.raw ? 'text-surface-900' : 'text-muted-foreground'}"
86
+ style="box-shadow: inset 0px 16px 16px -16px rgba(0, 0, 0, 0.1333);"
86
87
  name={state_key}
87
88
  bind:value={$internal.raw}
88
89
  />
@@ -111,9 +111,7 @@
111
111
  type="text"
112
112
  id="input_{state_key}"
113
113
  placeholder={label}
114
- class="block w-full {!isValid
115
- ? 'ring-danger-500'
116
- : 'ring-surface-300 focus:ring-primary-400'} focus:outline-none placeholder:text-surface-400 focus:ring-2 focus:ring-inset"
114
+ class="block w-full {!isValid ? 'ring-danger-500' : 'ring-surface-300'}"
117
115
  name={state_key}
118
116
  bind:value={$internal.raw}
119
117
  />
@@ -7,7 +7,7 @@
7
7
  import { fade } from "svelte/transition";
8
8
  import { Html5Qrcode } from "html5-qrcode";
9
9
  import { Button } from "@stubber/ui/button";
10
-
10
+ import { Input } from "@stubber/ui/input";
11
11
  import { Label } from "@stubber/ui/label";
12
12
 
13
13
  export let field;
@@ -170,20 +170,20 @@
170
170
  <div class="relative mt-2 rounded-md">
171
171
  <div class="flex items-center space-x-3">
172
172
  {#if $internal.raw}
173
- <input
173
+ <Input
174
174
  readonly
175
175
  type="text"
176
176
  id="input_{state_key}"
177
177
  placeholder={label}
178
- class="block w-full text-field rounded-md border-0 py-2 pl-3 text-surface-900 ring-1 ring-inset {!isValid
179
- ? 'ring-danger-500'
180
- : 'ring-surface-300 focus:ring-primary-400'} focus:outline-none placeholder:text-surface-400 focus:ring-2 focus:ring-inset"
181
178
  name={state_key}
182
179
  value={$internal.raw}
183
180
  />
184
181
  {/if}
185
182
  <div class="shrink-0">
186
- <Button icon="camera" label="Scan code" on:click={openScannerModal} />
183
+ <Button on:click={openScannerModal}>
184
+ <i class="fa-solid fa-qrcode" />
185
+ Scan Code
186
+ </Button>
187
187
  </div>
188
188
  </div>
189
189
  </div>
@@ -190,7 +190,7 @@
190
190
  flex h-7 w-full items-center justify-between rounded px-3 py-2
191
191
  text-sm focus:outline-none
192
192
  [&>span]:line-clamp-1 aria-[invalid]:border-destructive
193
- placeholder:text-black
193
+ placeholder:text-muted-foreground
194
194
  {!isValid ? 'ring-danger-500' : 'ring-surface-300 focus:ring-transparent'}"
195
195
  name={state_key}
196
196
  bind:value={filter_text}
@@ -236,7 +236,7 @@
236
236
  flex h-7 w-full items-center justify-between rounded px-3 py-2
237
237
  text-sm focus:outline-none
238
238
  [&>span]:line-clamp-1 aria-[invalid]:border-destructive
239
- placeholder:text-black
239
+ placeholder:text-muted-foreground
240
240
  {!isValid ? 'ring-danger-500' : 'ring-surface-300 focus:ring-transparent'}"
241
241
  bind:value={filter_text}
242
242
  autocomplete="off"
@@ -290,7 +290,7 @@
290
290
  .stubber-cm :global(.cm-editor.cm-focused) {
291
291
  outline: none;
292
292
  border-width: 1px;
293
- border-color: var(--ring);
293
+ border-color: hsl(var(--input) / var(--tw-border-opacity, 1));
294
294
  }
295
295
 
296
296
  .stubber-cm.stubber-valid :global(.cm-editor.cm-focused) {
@@ -318,18 +318,10 @@
318
318
  }
319
319
 
320
320
  .stubber-cm :global(.cm-editor .cm-placeholder) {
321
- color: var(--muted-foreground, rgb(165 169 173));
321
+ color: hsl(var(--muted-foreground) / var(--tw-text-opacity, 1));
322
322
  }
323
323
 
324
324
  .stubber-cm :global(.curly-braces-highlight) {
325
325
  color: rgb(9 103 210);
326
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%;
334
- }
335
327
  </style>
@@ -141,12 +141,10 @@
141
141
  bind:value={$internal.raw}
142
142
  type="tel"
143
143
  id="input_{state_key}"
144
- class="bg-gradient-to-b from-[#2727271F] to-[#27272719] shadow-select
145
- flex h-7 w-full items-center justify-between rounded px-3 py-2
146
- text-sm
147
- [&>span]:line-clamp-1 aria-[invalid]:border-destructive
148
- placeholder:text-black
149
- {!isValid ? 'ring-danger-500' : 'ring-surface-300 focus:ring-primary-400'}"
144
+ class="w-full pl-12 border-input bg-white bg-opacity-[15] ring-offset-background placeholder:text-muted-foreground focus-visible:ring-ring h-10 rounded-md border py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 {!isValid
145
+ ? 'ring-danger-500'
146
+ : 'ring-surface-300'}"
147
+ style="box-shadow: inset 0px 16px 16px -16px rgba(0, 0, 0, 0.1333);"
150
148
  />
151
149
  </div>
152
150
  {#if validationMessage}
@@ -79,7 +79,7 @@
79
79
  </script>
80
80
 
81
81
  {#if $internal}
82
- <div class="flex flex-col w-full text-surface-900 my-2">
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,7 @@
93
93
  type="text"
94
94
  id="input_{state_key}"
95
95
  placeholder={label}
96
- class="block w-full {!isValid ? 'ring-danger-500' : 'ring-surface-300 '} "
96
+ class="block w-full {!isValid ? 'ring-danger-500' : 'ring-surface-300 '}"
97
97
  name={state_key}
98
98
  bind:value={$internal.raw}
99
99
  />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stubber/form-fields",
3
- "version": "1.0.8",
3
+ "version": "1.0.11",
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
  }