uisv 0.0.14 → 0.0.15

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.
Files changed (43) hide show
  1. package/dist/components/alert.svelte +8 -2
  2. package/dist/components/alert.svelte.d.ts +2 -2
  3. package/dist/components/badge.svelte +18 -18
  4. package/dist/components/badge.svelte.d.ts +2 -2
  5. package/dist/components/banner.svelte +8 -2
  6. package/dist/components/banner.svelte.d.ts +2 -2
  7. package/dist/components/breadcrumb.svelte +75 -0
  8. package/dist/components/breadcrumb.svelte.d.ts +38 -0
  9. package/dist/components/button.svelte +58 -52
  10. package/dist/components/button.svelte.d.ts +6 -2
  11. package/dist/components/calendar.svelte +99 -0
  12. package/dist/components/calendar.svelte.d.ts +16 -0
  13. package/dist/components/card.svelte +11 -10
  14. package/dist/components/card.svelte.d.ts +2 -1
  15. package/dist/components/collapsible.svelte +76 -0
  16. package/dist/components/collapsible.svelte.d.ts +15 -0
  17. package/dist/components/icon.svelte +58 -0
  18. package/dist/components/icon.svelte.d.ts +8 -0
  19. package/dist/components/index.d.ts +12 -0
  20. package/dist/components/index.js +12 -0
  21. package/dist/components/input-number.svelte +175 -0
  22. package/dist/components/input-number.svelte.d.ts +38 -0
  23. package/dist/components/input-time.svelte +3 -4
  24. package/dist/components/input-time.svelte.d.ts +3 -4
  25. package/dist/components/input.svelte +2 -2
  26. package/dist/components/input.svelte.d.ts +2 -2
  27. package/dist/components/kbd.svelte +35 -35
  28. package/dist/components/kbd.svelte.d.ts +2 -2
  29. package/dist/components/pin-input.svelte +20 -20
  30. package/dist/components/pin-input.svelte.d.ts +2 -2
  31. package/dist/components/placeholder.svelte +1 -1
  32. package/dist/components/select.svelte +2 -2
  33. package/dist/components/select.svelte.d.ts +2 -2
  34. package/dist/components/seperator.svelte +212 -0
  35. package/dist/components/seperator.svelte.d.ts +22 -0
  36. package/dist/date.d.ts +1 -0
  37. package/dist/date.js +1 -0
  38. package/dist/index.d.ts +2 -0
  39. package/dist/utilities.svelte.d.ts +7 -0
  40. package/dist/utilities.svelte.js +20 -0
  41. package/dist/vite.d.ts +2 -3
  42. package/dist/vite.js +26 -16
  43. package/package.json +18 -23
@@ -1,5 +1,5 @@
1
1
  <script module lang="ts">
2
- import type { PropColor } from '../index.js';
2
+ import type { PropColor, PropVariant } from '../index.js';
3
3
  import type { Snippet } from 'svelte';
4
4
  import type { ClassNameValue } from 'tailwind-merge';
5
5
  import { tv } from 'tailwind-variants';
@@ -8,7 +8,7 @@
8
8
  children?: Snippet;
9
9
  value?: string;
10
10
  color?: PropColor;
11
- variant?: 'solid' | 'outline' | 'soft' | 'subtle';
11
+ variant?: Exclude<PropVariant, 'none' | 'ghost'>;
12
12
  size?: 'sm' | 'md' | 'lg';
13
13
  class?: ClassNameValue;
14
14
  };
@@ -35,7 +35,7 @@
35
35
  pageup: '⇞',
36
36
  pagedown: '⇟',
37
37
  home: '↖',
38
- end: '↘'
38
+ end: '↘',
39
39
  };
40
40
 
41
41
  export type KbdKey = keyof typeof KBD_KEYS;
@@ -49,7 +49,7 @@
49
49
  color = 'primary',
50
50
  variant = 'outline',
51
51
  size = 'md',
52
- class: klass
52
+ class: klass,
53
53
  }: KbdProps = $props();
54
54
 
55
55
  const macOS = $derived.by(() => {
@@ -61,7 +61,7 @@
61
61
  const kbdKeysSpecificMap = $derived({
62
62
  meta: macOS ? KBD_KEYS.command : 'Ctrl',
63
63
  alt: macOS ? KBD_KEYS.command : 'Ctrl',
64
- ctrl: macOS ? KBD_KEYS.option : 'Alt'
64
+ ctrl: macOS ? KBD_KEYS.option : 'Alt',
65
65
  });
66
66
 
67
67
  function getKey(value?: KbdKey | string) {
@@ -87,148 +87,148 @@
87
87
  info: '',
88
88
  success: '',
89
89
  warning: '',
90
- error: ''
90
+ error: '',
91
91
  },
92
92
  variant: {
93
93
  solid: 'text-white border border-b-3 border-r-2',
94
94
  outline: 'border border-b-3 border-r-2',
95
95
  soft: '',
96
- subtle: 'border border-b-3 border-r-2'
96
+ subtle: 'border border-b-3 border-r-2',
97
97
  },
98
98
  size: {
99
99
  sm: 'h-4 min-w-4',
100
100
  md: 'h-5 min-w-5',
101
- lg: 'h-6 min-w-6'
102
- }
101
+ lg: 'h-6 min-w-6',
102
+ },
103
103
  },
104
104
  compoundVariants: [
105
105
  {
106
106
  color: 'primary',
107
107
  variant: 'outline',
108
- class: 'border-primary text-primary'
108
+ class: 'border-primary text-primary',
109
109
  },
110
110
  {
111
111
  color: 'surface',
112
112
  variant: 'outline',
113
- class: 'border-surface-600'
113
+ class: 'border-surface-600',
114
114
  },
115
115
  {
116
116
  color: 'info',
117
117
  variant: 'outline',
118
- class: 'border-info text-info'
118
+ class: 'border-info text-info',
119
119
  },
120
120
  {
121
121
  color: 'success',
122
122
  variant: 'outline',
123
- class: 'border-success text-success'
123
+ class: 'border-success text-success',
124
124
  },
125
125
  {
126
126
  color: 'warning',
127
127
  variant: 'outline',
128
- class: 'border-warning text-warning'
128
+ class: 'border-warning text-warning',
129
129
  },
130
130
  {
131
131
  color: 'error',
132
132
  variant: 'outline',
133
- class: 'border-error text-error'
133
+ class: 'border-error text-error',
134
134
  },
135
135
 
136
136
  // SOLID
137
137
  {
138
138
  color: 'primary',
139
139
  variant: 'solid',
140
- class: 'bg-primary border-primary-600'
140
+ class: 'bg-primary border-primary-600',
141
141
  },
142
142
  {
143
143
  color: 'surface',
144
144
  variant: 'solid',
145
- class: 'bg-surface-600 border-surface-700'
145
+ class: 'bg-surface-600 border-surface-700',
146
146
  },
147
147
  {
148
148
  color: 'info',
149
149
  variant: 'solid',
150
- class: 'bg-info border-info-600'
150
+ class: 'bg-info border-info-600',
151
151
  },
152
152
  {
153
153
  color: 'success',
154
154
  variant: 'solid',
155
- class: 'bg-success border-success-600'
155
+ class: 'bg-success border-success-600',
156
156
  },
157
157
  {
158
158
  color: 'warning',
159
159
  variant: 'solid',
160
- class: 'bg-warning border-warning-600'
160
+ class: 'bg-warning border-warning-600',
161
161
  },
162
162
  {
163
163
  color: 'error',
164
164
  variant: 'solid',
165
- class: 'bg-error border-error-600'
165
+ class: 'bg-error border-error-600',
166
166
  },
167
167
 
168
168
  // SOFT
169
169
  {
170
170
  color: 'primary',
171
171
  variant: 'soft',
172
- class: 'bg-primary-100 text-primary'
172
+ class: 'bg-primary-100 text-primary',
173
173
  },
174
174
  {
175
175
  color: 'surface',
176
176
  variant: 'soft',
177
- class: 'bg-surface-100 text-surface-700'
177
+ class: 'bg-surface-100 text-surface-700',
178
178
  },
179
179
  {
180
180
  color: 'info',
181
181
  variant: 'soft',
182
- class: 'bg-info-100 text-info'
182
+ class: 'bg-info-100 text-info',
183
183
  },
184
184
  {
185
185
  color: 'success',
186
186
  variant: 'soft',
187
- class: 'bg-success-100 text-success'
187
+ class: 'bg-success-100 text-success',
188
188
  },
189
189
  {
190
190
  color: 'warning',
191
191
  variant: 'soft',
192
- class: 'bg-warning-100 text-warning'
192
+ class: 'bg-warning-100 text-warning',
193
193
  },
194
194
  {
195
195
  color: 'error',
196
196
  variant: 'soft',
197
- class: 'bg-error-100 text-error'
197
+ class: 'bg-error-100 text-error',
198
198
  },
199
199
 
200
200
  // SUBTLE
201
201
  {
202
202
  color: 'primary',
203
203
  variant: 'subtle',
204
- class: 'bg-primary-100 border-primary-200 text-primary'
204
+ class: 'bg-primary-100 border-primary-200 text-primary',
205
205
  },
206
206
  {
207
207
  color: 'surface',
208
208
  variant: 'subtle',
209
- class: 'bg-surface-100 border-surface-200 text-surface-700'
209
+ class: 'bg-surface-100 border-surface-200 text-surface-700',
210
210
  },
211
211
  {
212
212
  color: 'info',
213
213
  variant: 'subtle',
214
- class: 'bg-info-100 border-info-200 text-info'
214
+ class: 'bg-info-100 border-info-200 text-info',
215
215
  },
216
216
  {
217
217
  color: 'success',
218
218
  variant: 'subtle',
219
- class: 'bg-success-100 border-success-200 text-success'
219
+ class: 'bg-success-100 border-success-200 text-success',
220
220
  },
221
221
  {
222
222
  color: 'warning',
223
223
  variant: 'subtle',
224
- class: 'bg-warning-100 border-warning-200 text-warning'
224
+ class: 'bg-warning-100 border-warning-200 text-warning',
225
225
  },
226
226
  {
227
227
  color: 'error',
228
228
  variant: 'subtle',
229
- class: 'bg-error-100 border-error-200 text-error'
230
- }
231
- ]
229
+ class: 'bg-error-100 border-error-200 text-error',
230
+ },
231
+ ],
232
232
  })({ color, variant, size, class: [klass] })}
233
233
  >
234
234
  {#if value}
@@ -1,11 +1,11 @@
1
- import type { PropColor } from '../index.js';
1
+ import type { PropColor, PropVariant } from '../index.js';
2
2
  import type { Snippet } from 'svelte';
3
3
  import type { ClassNameValue } from 'tailwind-merge';
4
4
  export type KbdProps = {
5
5
  children?: Snippet;
6
6
  value?: string;
7
7
  color?: PropColor;
8
- variant?: 'solid' | 'outline' | 'soft' | 'subtle';
8
+ variant?: Exclude<PropVariant, 'none' | 'ghost'>;
9
9
  size?: 'sm' | 'md' | 'lg';
10
10
  class?: ClassNameValue;
11
11
  };
@@ -1,5 +1,5 @@
1
1
  <script module lang="ts">
2
- import type { PropColor } from '../index.js';
2
+ import type { PropColor, PropVariant } from '../index.js';
3
3
  import { onMount } from 'svelte';
4
4
  import type { ClassNameValue } from 'tailwind-merge';
5
5
  import { tv } from 'tailwind-variants';
@@ -7,7 +7,7 @@
7
7
  export type PinInputProps = {
8
8
  value?: number[] | string[];
9
9
  color?: PropColor;
10
- variant?: 'outline' | 'soft' | 'subtle' | 'ghost' | 'none';
10
+ variant?: Omit<PropVariant, 'solid'>;
11
11
  size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
12
12
  length?: number;
13
13
  autofocus?: boolean | number;
@@ -36,7 +36,7 @@
36
36
  'Tab',
37
37
  'Shift',
38
38
  'Control',
39
- 'Meta'
39
+ 'Meta',
40
40
  ];
41
41
 
42
42
  let {
@@ -54,7 +54,7 @@
54
54
  placeholder,
55
55
  required,
56
56
  type = 'text',
57
- ui = {}
57
+ ui = {},
58
58
  }: PinInputProps = $props();
59
59
  const internal_id = $props.id();
60
60
  let input_els = $state<HTMLInputElement[]>([]);
@@ -69,60 +69,60 @@
69
69
  info: '',
70
70
  success: '',
71
71
  warning: '',
72
- error: ''
72
+ error: '',
73
73
  },
74
74
  size: {
75
75
  xs: { root: '', cell: 'size-6' },
76
76
  sm: { root: '', cell: 'size-7' },
77
77
  md: { root: '', cell: 'size-8' },
78
78
  lg: { root: '', cell: 'size-9' },
79
- xl: { root: '', cell: 'size-10' }
79
+ xl: { root: '', cell: 'size-10' },
80
80
  },
81
81
  variant: {
82
82
  outline: {
83
- cell: 'border border-surface-300 focus:(border-2)'
83
+ cell: 'border border-surface-300 focus:(border-2)',
84
84
  },
85
85
  soft: {
86
- cell: 'bg-surface-50 hover:(bg-surface-100) focus:(bg-surface-100)'
86
+ cell: 'bg-surface-50 hover:bg-surface-100 focus:bg-surface-100',
87
87
  },
88
88
  subtle: { cell: 'border border-surface-300 bg-surface-100 focus:(border-2)' },
89
- ghost: { cell: 'hover:(bg-surface-100) focus:(bg-surface-100)' },
90
- none: { cell: '' }
91
- }
89
+ ghost: { cell: 'hover:bg-surface-100 focus:bg-surface-100' },
90
+ none: { cell: '' },
91
+ },
92
92
  },
93
93
  compoundVariants: [
94
94
  {
95
95
  variant: ['outline', 'subtle'],
96
96
  color: 'primary',
97
- class: { cell: 'focus:(border-primary-500)' }
97
+ class: { cell: 'focus:border-primary-500' },
98
98
  },
99
99
  {
100
100
  variant: ['outline', 'subtle'],
101
101
  color: 'surface',
102
- class: { cell: 'focus:(border-surface-900)' }
102
+ class: { cell: 'focus:border-surface-900' },
103
103
  },
104
104
  {
105
105
  variant: ['outline', 'subtle'],
106
106
  color: 'info',
107
- class: { cell: 'focus:(border-info-500)' }
107
+ class: { cell: 'focus:border-info-500' },
108
108
  },
109
109
  {
110
110
  variant: ['outline', 'subtle'],
111
111
  color: 'success',
112
- class: { cell: 'focus:(border-success-500)' }
112
+ class: { cell: 'focus:border-success-500' },
113
113
  },
114
114
  {
115
115
  variant: ['outline', 'subtle'],
116
116
  color: 'warning',
117
- class: { cell: 'focus:(border-warning-500)' }
117
+ class: { cell: 'focus:border-warning-500' },
118
118
  },
119
119
  {
120
120
  variant: ['outline', 'subtle'],
121
121
  color: 'error',
122
- class: { cell: 'focus:(border-error-500)' }
123
- }
124
- ]
125
- })({ size, color, variant, class: ui.root })
122
+ class: { cell: 'focus:border-error-500' },
123
+ },
124
+ ],
125
+ })({ size, color, variant, class: ui.root }),
126
126
  );
127
127
 
128
128
  onMount(() => {
@@ -1,9 +1,9 @@
1
- import type { PropColor } from '../index.js';
1
+ import type { PropColor, PropVariant } from '../index.js';
2
2
  import type { ClassNameValue } from 'tailwind-merge';
3
3
  export type PinInputProps = {
4
4
  value?: number[] | string[];
5
5
  color?: PropColor;
6
- variant?: 'outline' | 'soft' | 'subtle' | 'ghost' | 'none';
6
+ variant?: Omit<PropVariant, 'solid'>;
7
7
  size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
8
8
  length?: number;
9
9
  autofocus?: boolean | number;
@@ -8,7 +8,7 @@
8
8
  <svg
9
9
  {...rest}
10
10
  class={cx(
11
- 'inset-0 w-full stroke-surface/10 border border-dashed border-surface rounded-md',
11
+ 'inset-0 w-full stroke-surface-elevated border border-dashed border-surface-accented rounded-md',
12
12
  klass,
13
13
  )}
14
14
  fill="none"
@@ -1,5 +1,5 @@
1
1
  <script module lang="ts">
2
- import type { PropColor } from '../index.js';
2
+ import type { PropColor, PropVariant } from '../index.js';
3
3
  import { Select } from 'bits-ui';
4
4
  import type { Component, Snippet } from 'svelte';
5
5
  import { tv } from 'tailwind-variants';
@@ -18,7 +18,7 @@
18
18
  item?: Snippet<[{ item: SelectItem<T> }]>;
19
19
  color?: PropColor;
20
20
  size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
21
- variant?: 'outline' | 'soft' | 'subtle' | 'ghost' | 'none';
21
+ variant?: Exclude<PropVariant, 'solid'>;
22
22
  highlight?: boolean;
23
23
  placeholder?: string;
24
24
  } & (
@@ -1,4 +1,4 @@
1
- import type { PropColor } from '../index.js';
1
+ import type { PropColor, PropVariant } from '../index.js';
2
2
  import { Select } from 'bits-ui';
3
3
  import type { Component, Snippet } from 'svelte';
4
4
  export type SelectItem<T> = T | {
@@ -14,7 +14,7 @@ export type SelectProps<T> = {
14
14
  }]>;
15
15
  color?: PropColor;
16
16
  size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
17
- variant?: 'outline' | 'soft' | 'subtle' | 'ghost' | 'none';
17
+ variant?: Exclude<PropVariant, 'solid'>;
18
18
  highlight?: boolean;
19
19
  placeholder?: string;
20
20
  } & ({
@@ -0,0 +1,212 @@
1
+ <script module lang="ts">
2
+ import { Icon, type PropColor, isComponent, isSnippet } from '../index.js';
3
+ import type { Snippet } from 'svelte';
4
+ import type { ClassNameValue } from 'tailwind-merge';
5
+ import { tv } from 'tailwind-variants';
6
+ import type { Component } from 'svelte';
7
+
8
+ export type SeperatorProps = {
9
+ label?: string | Snippet<[ClassNameValue]> | Component;
10
+ icon?: string | Component;
11
+ color?: PropColor;
12
+ type?: 'dashed' | 'solid' | 'dotted';
13
+ children?: Snippet;
14
+ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
15
+ orientation?: 'horizontal' | 'vertical';
16
+ ui?: {
17
+ root?: ClassNameValue;
18
+ border?: ClassNameValue;
19
+ icon?: ClassNameValue;
20
+ label?: ClassNameValue;
21
+ };
22
+ };
23
+ </script>
24
+
25
+ <script lang="ts">
26
+ let {
27
+ label,
28
+ icon,
29
+ children,
30
+ color = 'primary',
31
+ type = 'solid',
32
+ size = 'xs',
33
+ orientation = 'horizontal',
34
+ ui = {},
35
+ }: SeperatorProps = $props();
36
+
37
+ const variants = $derived(
38
+ tv({
39
+ slots: {
40
+ root: 'flex items-center justify-center text-center',
41
+ border: '',
42
+ icon: 'shrink-0 size-5',
43
+ label: 'text-sm',
44
+ },
45
+ variants: {
46
+ type: {
47
+ solid: {
48
+ border: 'border-solid',
49
+ },
50
+ dashed: {
51
+ border: 'border-dashed',
52
+ },
53
+ dotted: {
54
+ border: 'border-dotted',
55
+ },
56
+ },
57
+ size: {
58
+ xs: {
59
+ root: 'gap-3',
60
+ },
61
+ sm: {
62
+ root: 'gap-3',
63
+ },
64
+ md: {
65
+ root: 'gap-4',
66
+ },
67
+ lg: {
68
+ root: 'gap-5',
69
+ },
70
+ xl: {
71
+ root: 'gap-5',
72
+ },
73
+ },
74
+ color: {
75
+ primary: {
76
+ border: 'border-primary',
77
+ label: 'text-primary',
78
+ icon: 'text-primary',
79
+ },
80
+ surface: {
81
+ border: 'border-surface',
82
+ label: 'text-surface',
83
+ icon: 'text-surface',
84
+ },
85
+ info: {
86
+ border: 'border-info',
87
+ label: 'text-info',
88
+ icon: 'text-info',
89
+ },
90
+ success: {
91
+ border: 'border-success',
92
+ label: 'text-success',
93
+ icon: 'text-success',
94
+ },
95
+ warning: {
96
+ border: 'border-warning',
97
+ label: 'text-warning',
98
+ icon: 'text-warning',
99
+ },
100
+ error: {
101
+ border: 'border-error',
102
+ label: 'text-error',
103
+ icon: 'text-error',
104
+ },
105
+ },
106
+ orientation: {
107
+ horizontal: {
108
+ root: 'w-full flex-row',
109
+ border: 'w-full',
110
+ },
111
+ vertical: {
112
+ root: 'h-full flex-col',
113
+ border: 'h-full',
114
+ },
115
+ },
116
+ },
117
+ compoundVariants: [
118
+ {
119
+ orientation: 'horizontal',
120
+ size: 'xs',
121
+ class: {
122
+ border: 'border-t',
123
+ },
124
+ },
125
+ {
126
+ orientation: 'horizontal',
127
+ size: 'sm',
128
+ class: {
129
+ border: 'border-t-2',
130
+ },
131
+ },
132
+ {
133
+ orientation: 'horizontal',
134
+ size: 'md',
135
+ class: {
136
+ border: 'border-t-3',
137
+ },
138
+ },
139
+ {
140
+ orientation: 'horizontal',
141
+ size: 'lg',
142
+ class: {
143
+ border: 'border-t-4',
144
+ },
145
+ },
146
+ {
147
+ orientation: 'horizontal',
148
+ size: 'xl',
149
+ class: {
150
+ border: 'border-t-5',
151
+ },
152
+ },
153
+ {
154
+ orientation: 'vertical',
155
+ size: 'xs',
156
+ class: {
157
+ border: 'border-s',
158
+ },
159
+ },
160
+ {
161
+ orientation: 'vertical',
162
+ size: 'sm',
163
+ class: {
164
+ border: 'border-s-2',
165
+ },
166
+ },
167
+ {
168
+ orientation: 'vertical',
169
+ size: 'md',
170
+ class: {
171
+ border: 'border-s-3',
172
+ },
173
+ },
174
+ {
175
+ orientation: 'vertical',
176
+ size: 'lg',
177
+ class: {
178
+ border: 'border-s-4',
179
+ },
180
+ },
181
+ {
182
+ orientation: 'vertical',
183
+ size: 'xl',
184
+ class: {
185
+ border: 'border-s-5',
186
+ },
187
+ },
188
+ ],
189
+ })({ size, type, color, orientation }),
190
+ );
191
+ </script>
192
+
193
+ <div class={variants.root({ class: ui.root })}>
194
+ <span class={variants.border({ class: ui.border })}></span>
195
+
196
+ {#if icon || label || children}
197
+ {#if icon}
198
+ <Icon name={icon} class={variants.icon({})} />
199
+ {:else if typeof label === 'string' && label.length > 0}
200
+ <span class={variants.label({ class: ui.label })}>{label}</span>
201
+ {:else if isSnippet(label)}
202
+ {@render label()}
203
+ {:else if isComponent(label)}
204
+ {@const Label = label}
205
+ <Label class={variants.label({ class: ui.label })} />
206
+ {:else}
207
+ {@render children?.()}
208
+ {/if}
209
+
210
+ <span class={variants.border({ class: ui.border })}></span>
211
+ {/if}
212
+ </div>
@@ -0,0 +1,22 @@
1
+ import { type PropColor } from '../index.js';
2
+ import type { Snippet } from 'svelte';
3
+ import type { ClassNameValue } from 'tailwind-merge';
4
+ import type { Component } from 'svelte';
5
+ export type SeperatorProps = {
6
+ label?: string | Snippet<[ClassNameValue]> | Component;
7
+ icon?: string | Component;
8
+ color?: PropColor;
9
+ type?: 'dashed' | 'solid' | 'dotted';
10
+ children?: Snippet;
11
+ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
12
+ orientation?: 'horizontal' | 'vertical';
13
+ ui?: {
14
+ root?: ClassNameValue;
15
+ border?: ClassNameValue;
16
+ icon?: ClassNameValue;
17
+ label?: ClassNameValue;
18
+ };
19
+ };
20
+ declare const Seperator: Component<SeperatorProps, {}, "">;
21
+ type Seperator = ReturnType<typeof Seperator>;
22
+ export default Seperator;
package/dist/date.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from '@internationalized/date';
package/dist/date.js ADDED
@@ -0,0 +1 @@
1
+ export * from '@internationalized/date';
package/dist/index.d.ts CHANGED
@@ -2,3 +2,5 @@ export * from './components/index.js';
2
2
  export * from './utilities.svelte.js';
3
3
  export type PropColor = 'primary' | 'surface' | 'info' | 'success' | 'warning' | 'error';
4
4
  export declare const COLORS: PropColor[];
5
+ export type PropVariant = 'solid' | 'outline' | 'soft' | 'subtle' | 'ghost' | 'none';
6
+ export type PropSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
@@ -22,3 +22,10 @@ export declare const isSnippet: (v: unknown) => v is Snippet;
22
22
  * @returns an array of dom rects.
23
23
  */
24
24
  export declare function useElementRects(nodes: MaybeGetter<HTMLElement[]>, options?: ElementSizeOptions): DOMRect[];
25
+ /**
26
+ * Inject reactive style element in head.
27
+ * @param css string
28
+ */
29
+ export declare function useStyle(css: MaybeGetter<string>): {
30
+ id: string;
31
+ };
@@ -45,3 +45,23 @@ export function useElementRects(nodes, options = {}) {
45
45
  });
46
46
  return rects;
47
47
  }
48
+ let uisv_usestyle_id = 0;
49
+ /**
50
+ * Inject reactive style element in head.
51
+ * @param css string
52
+ */
53
+ export function useStyle(css) {
54
+ const id = `uisv_styletag_${++uisv_usestyle_id}`;
55
+ let el = $state();
56
+ $effect(() => {
57
+ if (!el) {
58
+ el = (document.getElementById(id) || document.createElement('style'));
59
+ if (!el.isConnected) {
60
+ el.id = id;
61
+ document.head.appendChild(el);
62
+ }
63
+ }
64
+ el.textContent = extract(css);
65
+ });
66
+ return { id };
67
+ }