@ai-ecoverse/slicc-spectrum 1.91.0 → 1.92.0

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.
@@ -6,7 +6,7 @@ import {
6
6
  DummySettings,
7
7
  clock,
8
8
  dummySettingsKey
9
- } from "./chunk-VRFAMBWK.js";
9
+ } from "./chunk-3CM23WFV.js";
10
10
  import {
11
11
  Emitter
12
12
  } from "./chunk-T5NHW4KC.js";
package/dist/slicc-ui.js CHANGED
@@ -39792,7 +39792,8 @@ var fieldStyles = i`
39792
39792
  font-size: var(--swc-font-size-75);
39793
39793
  color: var(--swc-neutral-subdued-content-color-default);
39794
39794
  }
39795
- .field input:not([type='checkbox']) {
39795
+ .field input:not([type='checkbox']),
39796
+ .field select {
39796
39797
  box-sizing: border-box;
39797
39798
  inline-size: 100%;
39798
39799
  font: inherit;
@@ -39803,7 +39804,8 @@ var fieldStyles = i`
39803
39804
  background: var(--swc-background-layer-2-color);
39804
39805
  color: inherit;
39805
39806
  }
39806
- .field input[aria-invalid='true'] {
39807
+ .field input[aria-invalid='true'],
39808
+ .field select[aria-invalid='true'] {
39807
39809
  border-color: var(--swc-negative-border-color-default);
39808
39810
  }
39809
39811
  .field input[type='file'] {
@@ -39820,6 +39822,7 @@ var fieldStyles = i`
39820
39822
  color: inherit;
39821
39823
  }
39822
39824
  .field input:focus-visible,
39825
+ .field select:focus-visible,
39823
39826
  input[type='checkbox']:focus-visible {
39824
39827
  outline: var(--swc-focus-indicator-thickness) solid var(--swc-focus-indicator-color);
39825
39828
  outline-offset: var(--swc-focus-ring-gap);
@@ -43164,7 +43167,7 @@ var SliccSettings = class extends ThemedElement {
43164
43167
  this.problem = { id, field, message };
43165
43168
  void this.updateComplete.then(
43166
43169
  () => this.renderRoot.querySelector(
43167
- field === "value" ? ".key input[data-field=value]" : `.key input[data-account-field="${field}"]`
43170
+ field === "value" ? ".key input[data-field=value]" : `.key [data-account-field="${field}"]`
43168
43171
  )?.focus()
43169
43172
  );
43170
43173
  }
@@ -43172,12 +43175,10 @@ var SliccSettings = class extends ThemedElement {
43172
43175
  if (!account.fields?.length) return void 0;
43173
43176
  const values = {};
43174
43177
  for (const field of account.fields) {
43175
- const input = form.querySelector(
43176
- `input[data-account-field="${field.name}"]`
43177
- );
43178
+ const input = form.querySelector(`[data-account-field="${field.name}"]`);
43178
43179
  const value = input.value.trim();
43179
43180
  if (value) values[field.name] = value;
43180
- else if (field.required) {
43181
+ else if (field.required && field.options?.length !== 0) {
43181
43182
  this.#refuse(account.id, field.name, `${field.label} can\u2019t be empty`);
43182
43183
  return null;
43183
43184
  }
@@ -43244,7 +43245,26 @@ var SliccSettings = class extends ThemedElement {
43244
43245
  }
43245
43246
  #extra(account) {
43246
43247
  return (account.fields ?? []).map(
43247
- (field) => b`<label class="field"><span>${field.label}</span><input
43248
+ (field) => b`<label class="field">
43249
+ <span>${field.label}</span>${this.#control(account, field)}
43250
+ </label>
43251
+ ${this.#problem(account, field.name)}`
43252
+ );
43253
+ }
43254
+ #control(account, field) {
43255
+ if (field.options) {
43256
+ const chosen = field.value ?? field.options[0]?.value;
43257
+ return b`<select
43258
+ data-account-field=${field.name}
43259
+ ?disabled=${!field.options.length}
43260
+ aria-required=${field.required ? "true" : A}
43261
+ aria-invalid=${this.#invalid(account, field.name)}
43262
+ aria-describedby=${this.#described(account, field.name)}
43263
+ >
43264
+ ${field.options.map((option2) => b`<option value=${option2.value} ?selected=${option2.value === chosen}>${option2.label}</option>`)}
43265
+ </select>`;
43266
+ }
43267
+ return b`<input
43248
43268
  type="text"
43249
43269
  autocomplete="off"
43250
43270
  spellcheck="false"
@@ -43252,9 +43272,7 @@ var SliccSettings = class extends ThemedElement {
43252
43272
  aria-required=${field.required ? "true" : A}
43253
43273
  aria-invalid=${this.#invalid(account, field.name)}
43254
43274
  aria-describedby=${this.#described(account, field.name)}
43255
- /></label>
43256
- ${this.#problem(account, field.name)}`
43257
- );
43275
+ />`;
43258
43276
  }
43259
43277
  #unlock(vault) {
43260
43278
  return b`<div class="locked" data-locked>