@kahitsan/ksui 0.47.2 → 0.47.3

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@kahitsan/ksui",
3
- "version": "0.47.2",
3
+ "version": "0.47.3",
4
4
  "description": "ksui is a standalone set of SolidJS UI components for KahitSan/Hilinga and any SolidJS app. Published to the public npm registry and consumed as a normal dependency. Ships source under a `solid` export condition so the consumer's vite-plugin-solid compiles it with only solid-js externalized; it depends on nothing but solid-js + lucide-solid and injects its own CSS.",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -52,6 +52,9 @@ interface ComboBoxCommonProps<T> {
52
52
  icon: (p: { size?: number; class?: string }) => JSX.Element;
53
53
  /** Singular noun for UI copy: "payee", "client". */
54
54
  noun: string;
55
+ /** Custom text for the create row, given the typed name. Defaults to
56
+ * `New <noun> "<name>"`. */
57
+ createLabel?: (name: string) => string;
55
58
 
56
59
  placeholder?: string;
57
60
  disabled?: boolean;
@@ -303,7 +306,12 @@ function SingleComboBox<T>(props: ComboBoxSingleProps<T>): JSX.Element {
303
306
  <UserPlus size={14} class="text-[var(--ks-success-fg,#34d399)] shrink-0" />
304
307
  </Show>
305
308
  <span class="text-sm text-[var(--ks-success-fg,#34d399)]">
306
- New {props.noun} "<span class="font-medium">{eng.trimmedQuery()}</span>"
309
+ <Show
310
+ when={props.createLabel}
311
+ fallback={<>New {props.noun} "<span class="font-medium">{eng.trimmedQuery()}</span>"</>}
312
+ >
313
+ {(label) => label()(eng.trimmedQuery())}
314
+ </Show>
307
315
  </span>
308
316
  </button>
309
317
  </div>
@@ -606,7 +614,12 @@ function MultiComboBox<T>(props: ComboBoxMultiProps<T>): JSX.Element {
606
614
  <UserPlus size={14} class="text-[var(--ks-success-fg,#34d399)] shrink-0 mt-0.5" />
607
615
  </Show>
608
616
  <span class="flex-1 text-[var(--ks-success-fg,#34d399)]">
609
- New {props.noun} "<span class="font-medium">{eng.trimmedQuery()}</span>"
617
+ <Show
618
+ when={props.createLabel}
619
+ fallback={<>New {props.noun} "<span class="font-medium">{eng.trimmedQuery()}</span>"</>}
620
+ >
621
+ {(label) => label()(eng.trimmedQuery())}
622
+ </Show>
610
623
  </span>
611
624
  </button>
612
625
  </Show>