uisv 0.0.16 → 0.0.18

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.
@@ -54,5 +54,5 @@
54
54
  <div {...rest as SvelteHTMLElements['div']} class={[name, classname]}></div>
55
55
  {:else if isComponent(name)}
56
56
  {@const Icon = name}
57
- <Icon {...rest} />
57
+ <Icon {...rest} class={classname} />
58
58
  {/if}
@@ -41,8 +41,8 @@
41
41
  value?: string;
42
42
  icon?: string | Component;
43
43
  iconposition?: 'leading' | 'trailing';
44
- leading?: string | Component;
45
- trailing?: string | Component;
44
+ leading?: string | Component | Snippet;
45
+ trailing?: string | Component | Snippet;
46
46
  loading?: boolean;
47
47
  loadingicon?: string | Component;
48
48
  mask?: string | MaskInputOptions;
@@ -259,11 +259,11 @@
259
259
  {#if !!trailing}
260
260
  {#if typeof trailing === 'string'}
261
261
  {trailing}
262
- {:else if isSnippet(trailing)}
263
- {@render trailing()}
264
262
  {:else if isComponent(trailing)}
265
263
  {@const Trailing = trailing}
266
264
  <Trailing />
265
+ {:else if isSnippet(trailing)}
266
+ {@render trailing()}
267
267
  {/if}
268
268
  {:else if typeof icon === 'string'}
269
269
  <div
@@ -1,5 +1,5 @@
1
1
  import { type PropColor, type PropVariant } from '../index.js';
2
- import type { Component } from 'svelte';
2
+ import type { Component, Snippet } from 'svelte';
3
3
  import type { SvelteHTMLElements } from 'svelte/elements';
4
4
  import type { ClassNameValue } from 'tailwind-merge';
5
5
  import { type MaskInputOptions } from 'maska';
@@ -37,8 +37,8 @@ export type InputProps = Omit<SvelteHTMLElements['input'], 'size'> & {
37
37
  value?: string;
38
38
  icon?: string | Component;
39
39
  iconposition?: 'leading' | 'trailing';
40
- leading?: string | Component;
41
- trailing?: string | Component;
40
+ leading?: string | Component | Snippet;
41
+ trailing?: string | Component | Snippet;
42
42
  loading?: boolean;
43
43
  loadingicon?: string | Component;
44
44
  mask?: string | MaskInputOptions;
@@ -5,7 +5,7 @@ import { extract, useMutationObserver, useResizeObserver, } from 'runed';
5
5
  * @returns true if the value is a component, false otherwise
6
6
  */
7
7
  export function isComponent(v) {
8
- return typeof v === 'function' || (typeof v === 'object' && v !== null && !('$$render' in v));
8
+ return typeof v === 'function' && 'render' in v;
9
9
  }
10
10
  /**
11
11
  * Checks if a value is a Svelte snippet
@@ -13,7 +13,7 @@ export function isComponent(v) {
13
13
  * @returns true if the value is a snippet, false otherwise
14
14
  */
15
15
  export function isSnippet(v) {
16
- return typeof v === 'object' && v !== null && '$$render' in v;
16
+ return typeof v === 'function' && !('render' in v);
17
17
  }
18
18
  /**
19
19
  * Returns a reactive value holding the dom rect of `node`s.
package/dist/vite.js CHANGED
@@ -106,17 +106,7 @@ export function uisv(options) {
106
106
  presetWebFonts(_opts.fonts),
107
107
  presetIcons(_opts.icons),
108
108
  ],
109
- transformers: [
110
- transformerVariantGroup(),
111
- transformerCompileClass(),
112
- transformerDirectives(),
113
- {
114
- name: 'transformer-test',
115
- transform(code, id, ctx) {
116
- console.log(id);
117
- },
118
- },
119
- ],
109
+ transformers: [transformerVariantGroup(), transformerCompileClass(), transformerDirectives()],
120
110
  extendTheme: (theme) => {
121
111
  if (!('colors' in theme) || typeof theme.colors !== 'object')
122
112
  theme.colors = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uisv",
3
- "version": "0.0.16",
3
+ "version": "0.0.18",
4
4
  "description": "ui library for the rest of us",
5
5
  "license": "MIT",
6
6
  "repository": "ui-sv/uisv",