noph-ui 0.48.1 → 0.49.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.
@@ -104,11 +104,10 @@
104
104
  </script>
105
105
 
106
106
  {#snippet item(option: AutoCompleteOption, index: number)}
107
- {#snippet supportingText()}
108
- {option.supportingText}
109
- {/snippet}
110
107
  <Item
111
108
  id="{uid}-opt-{index}"
109
+ class={option.class}
110
+ style={option.style}
112
111
  softFocus={index === activeIndex}
113
112
  aria-selected={index === activeIndex}
114
113
  role="option"
@@ -125,7 +124,7 @@
125
124
  variant="button"
126
125
  start={option.start}
127
126
  end={option.end}
128
- supportingText={option.supportingText ? supportingText : undefined}
127
+ supportingText={option.supportingText}
129
128
  >{option.label}
130
129
  </Item>
131
130
  {/snippet}
@@ -1,11 +1,8 @@
1
+ import type { ItemProps } from '../list/types.js';
1
2
  import type { TextFieldProps } from '../types.js';
2
- import type { Snippet } from 'svelte';
3
- export interface AutoCompleteOption {
3
+ export interface AutoCompleteOption extends Pick<ItemProps, 'start' | 'end' | 'supportingText' | 'class' | 'style'> {
4
4
  value?: string | number;
5
5
  label: string;
6
- start?: Snippet;
7
- end?: Snippet;
8
- supportingText?: string;
9
6
  }
10
7
  export interface AutoCompleteProps extends Omit<TextFieldProps, 'clientWidth' | 'clientHeight'> {
11
8
  options: AutoCompleteOption[];
@@ -32,7 +32,11 @@
32
32
  </div>
33
33
  {#if supportingText}
34
34
  <div class="np-item-supporting-text">
35
- {@render supportingText()}
35
+ {#if typeof supportingText === 'string'}
36
+ {supportingText}
37
+ {:else}
38
+ {@render supportingText()}
39
+ {/if}
36
40
  </div>
37
41
  {/if}
38
42
  </div>
@@ -7,7 +7,7 @@ export interface ItemProps extends HTMLAttributes<ItemElement>, Omit<HTMLButtonA
7
7
  end?: Snippet;
8
8
  disabled?: boolean;
9
9
  variant?: 'button' | 'link' | 'text';
10
- supportingText?: Snippet;
10
+ supportingText?: string | Snippet;
11
11
  softFocus?: boolean;
12
12
  lazy?: boolean;
13
13
  type?: 'submit' | 'reset' | 'button' | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "noph-ui",
3
- "version": "0.48.1",
3
+ "version": "0.49.0",
4
4
  "license": "MIT",
5
5
  "homepage": "https://noph.dev",
6
6
  "repository": {