uisv 0.0.7 → 0.0.9

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 (45) hide show
  1. package/package.json +38 -37
  2. package/dist/components/accordion.svelte +0 -108
  3. package/dist/components/accordion.svelte.d.ts +0 -58
  4. package/dist/components/alert.svelte +0 -272
  5. package/dist/components/alert.svelte.d.ts +0 -24
  6. package/dist/components/badge.svelte +0 -227
  7. package/dist/components/badge.svelte.d.ts +0 -19
  8. package/dist/components/banner.svelte +0 -255
  9. package/dist/components/banner.svelte.d.ts +0 -24
  10. package/dist/components/button.svelte +0 -384
  11. package/dist/components/button.svelte.d.ts +0 -49
  12. package/dist/components/card.svelte +0 -70
  13. package/dist/components/card.svelte.d.ts +0 -17
  14. package/dist/components/checkbox.svelte +0 -175
  15. package/dist/components/checkbox.svelte.d.ts +0 -27
  16. package/dist/components/checkboxgroup.svelte +0 -259
  17. package/dist/components/checkboxgroup.svelte.d.ts +0 -26
  18. package/dist/components/chip.svelte +0 -82
  19. package/dist/components/chip.svelte.d.ts +0 -17
  20. package/dist/components/h1.svelte +0 -28
  21. package/dist/components/h1.svelte.d.ts +0 -11
  22. package/dist/components/h2.svelte +0 -30
  23. package/dist/components/h2.svelte.d.ts +0 -11
  24. package/dist/components/index.d.ts +0 -34
  25. package/dist/components/index.js +0 -34
  26. package/dist/components/kbd.svelte +0 -239
  27. package/dist/components/kbd.svelte.d.ts +0 -40
  28. package/dist/components/p.svelte +0 -22
  29. package/dist/components/p.svelte.d.ts +0 -11
  30. package/dist/components/pin-input.svelte +0 -162
  31. package/dist/components/pin-input.svelte.d.ts +0 -25
  32. package/dist/components/placeholder.svelte +0 -32
  33. package/dist/components/placeholder.svelte.d.ts +0 -7
  34. package/dist/components/progress.svelte +0 -124
  35. package/dist/components/progress.svelte.d.ts +0 -21
  36. package/dist/components/slider.svelte +0 -172
  37. package/dist/components/slider.svelte.d.ts +0 -44
  38. package/dist/components/switch.svelte +0 -180
  39. package/dist/components/switch.svelte.d.ts +0 -27
  40. package/dist/index.d.ts +0 -4
  41. package/dist/index.js +0 -3
  42. package/dist/utils/common.d.ts +0 -13
  43. package/dist/utils/common.js +0 -16
  44. package/dist/vite.d.ts +0 -38
  45. package/dist/vite.js +0 -57
@@ -1,227 +0,0 @@
1
- <script lang="ts" module>
2
- import type { Component, Snippet } from 'svelte';
3
-
4
- export type BadgeProps = {
5
- label?: string;
6
- color?: PropColor;
7
- variant?: 'solid' | 'outline' | 'soft' | 'subtle';
8
- size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
9
- icon?: string | Snippet | Component;
10
- trailingicon?: boolean;
11
- children?: Snippet;
12
- ui?: {
13
- base?: ClassNameValue;
14
- icon?: ClassNameValue;
15
- };
16
- };
17
- </script>
18
-
19
- <script lang="ts">
20
- import { tv } from 'tailwind-variants';
21
- import { isSnippet } from '../utils/common.js';
22
- import type { PropColor } from '../index.js';
23
- import type { ClassNameValue } from 'tailwind-merge';
24
-
25
- let {
26
- icon,
27
- label,
28
- trailingicon,
29
- color = 'primary',
30
- size = 'md',
31
- variant = 'solid',
32
- ui = {},
33
- children
34
- }: BadgeProps = $props();
35
-
36
- const classes = $derived.by(() => {
37
- return tv({
38
- slots: { icon: '', base: 'flex-inline items-center font-sans' },
39
- variants: {
40
- color: {
41
- primary: '',
42
- secondary: '',
43
- error: '',
44
- success: '',
45
- info: '',
46
- warning: ''
47
- },
48
- variant: {
49
- link: '',
50
- solid: 'text-white',
51
- outline: 'border',
52
- soft: '',
53
- subtle: 'border',
54
- ghost: ''
55
- },
56
- size: {
57
- xs: {
58
- base: 'font-medium text-[0.5rem] px-1 h-4 rounded gap-1',
59
- icon: 'size-3'
60
- },
61
- sm: { base: 'font-medium text-[0.625rem] px-1 h-5 rounded gap-1', icon: 'size-3' },
62
- md: { base: 'font-medium text-xs rounded-md px-2 h-6 gap-2', icon: 'size-4' },
63
- lg: { base: 'font-medium text-sm px-2 h-7 rounded-md gap-2', icon: 'size-5' },
64
- xl: { base: 'font-medium px-3 h-8 rounded-md gap-2', icon: 'size-5' }
65
- }
66
- },
67
- compoundVariants: [
68
- {
69
- color: 'primary',
70
- variant: 'solid',
71
- class: 'bg-primary-400'
72
- },
73
- {
74
- color: 'secondary',
75
- variant: 'solid',
76
- class: 'bg-secondary-900'
77
- },
78
- {
79
- color: 'info',
80
- variant: 'solid',
81
- class: 'bg-blue-500'
82
- },
83
- {
84
- color: 'success',
85
- variant: 'solid',
86
- class: 'bg-green-500'
87
- },
88
- {
89
- color: 'error',
90
- variant: 'solid',
91
- class: 'bg-red-500'
92
- },
93
- {
94
- color: 'warning',
95
- variant: 'solid',
96
- class: 'bg-yellow-500'
97
- },
98
-
99
- {
100
- color: 'primary',
101
- variant: 'outline',
102
- class: 'border-primary-300 text-primary-400'
103
- },
104
- {
105
- color: 'secondary',
106
- variant: 'outline',
107
- class: 'border-secondary-300 text-secondary-900'
108
- },
109
- {
110
- color: 'info',
111
- variant: 'outline',
112
- class: 'border-blue-300 text-blue-500'
113
- },
114
- {
115
- color: 'success',
116
- variant: 'outline',
117
- class: 'border-green-300 text-green-500'
118
- },
119
- {
120
- color: 'error',
121
- variant: 'outline',
122
- class: 'border-red-300 text-red-500'
123
- },
124
- {
125
- color: 'warning',
126
- variant: 'outline',
127
- class: 'border-yellow-300 text-yellow-500'
128
- },
129
-
130
- {
131
- color: 'primary',
132
- variant: 'soft',
133
- class: ' bg-primary-50 text-primary-500'
134
- },
135
- {
136
- color: 'secondary',
137
- variant: 'soft',
138
- class: 'bg-secondary-100 text-secondary-800'
139
- },
140
- {
141
- color: 'info',
142
- variant: 'soft',
143
- class: 'bg-blue-100 text-blue-500'
144
- },
145
- {
146
- color: 'success',
147
- variant: 'soft',
148
- class: 'bg-green-100 text-green-500'
149
- },
150
- {
151
- color: 'error',
152
- variant: 'soft',
153
- class: 'bg-red-100 text-red-500'
154
- },
155
- {
156
- color: 'warning',
157
- variant: 'soft',
158
- class: 'bg-yellow-100 text-yellow-500 '
159
- },
160
-
161
- {
162
- color: 'primary',
163
- variant: 'subtle',
164
- class: 'bg-primary-50 text-primary-500 border-primary-200 '
165
- },
166
- {
167
- color: 'secondary',
168
- variant: 'subtle',
169
- class: 'bg-secondary-100 text-secondary-800 border-secondary-300 '
170
- },
171
- {
172
- color: 'info',
173
- variant: 'subtle',
174
- class: 'bg-blue-50 text-blue-600 border-blue-200'
175
- },
176
- {
177
- color: 'success',
178
- variant: 'subtle',
179
- class: 'bg-green-100 text-green-600 border-green-300'
180
- },
181
- {
182
- color: 'error',
183
- variant: 'subtle',
184
- class: 'bg-red-50 text-red-600 border-red-200'
185
- },
186
- {
187
- color: 'warning',
188
- variant: 'subtle',
189
- class: 'bg-yellow-50 text-yellow-600 border-yellow-300'
190
- }
191
- ]
192
- })({ variant, size, color });
193
- });
194
- </script>
195
-
196
- <span
197
- class={classes.base({
198
- class: [icon && !(children || label) ? 'px-0 aspect-square justify-center' : '', ui.base]
199
- })}
200
- >
201
- {#if !trailingicon}
202
- {@render Icon()}
203
- {/if}
204
-
205
- {#if label}
206
- {label}
207
- {:else}
208
- {@render children?.()}
209
- {/if}
210
-
211
- {#if trailingicon}
212
- {@render Icon()}
213
- {/if}
214
- </span>
215
-
216
- {#snippet Icon()}
217
- {#if icon}
218
- {#if typeof icon === 'string'}
219
- <div class={['pi', icon, classes.icon(), ui.icon]}></div>
220
- {:else if isSnippet(icon)}
221
- {@render icon()}
222
- {:else}
223
- {@const Icon = icon}
224
- <Icon />
225
- {/if}
226
- {/if}
227
- {/snippet}
@@ -1,19 +0,0 @@
1
- import type { Component, Snippet } from 'svelte';
2
- export type BadgeProps = {
3
- label?: string;
4
- color?: PropColor;
5
- variant?: 'solid' | 'outline' | 'soft' | 'subtle';
6
- size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
7
- icon?: string | Snippet | Component;
8
- trailingicon?: boolean;
9
- children?: Snippet;
10
- ui?: {
11
- base?: ClassNameValue;
12
- icon?: ClassNameValue;
13
- };
14
- };
15
- import type { PropColor } from '../index.js';
16
- import type { ClassNameValue } from 'tailwind-merge';
17
- declare const Badge: Component<BadgeProps, {}, "">;
18
- type Badge = ReturnType<typeof Badge>;
19
- export default Badge;
@@ -1,255 +0,0 @@
1
- <script module lang="ts">
2
- import { isSnippet, type PropColor } from '../index.js';
3
- import type { Component, Snippet } from 'svelte';
4
- import Button, { type ButtonProps } from './button.svelte';
5
- import type { ClassNameValue } from 'tailwind-merge';
6
- import { tv } from 'tailwind-variants';
7
- import { defu } from 'defu';
8
- import { useId } from 'bits-ui';
9
-
10
- export type BannerProps = {
11
- title: string | Snippet;
12
- icon?: string | Snippet | Component;
13
- color?: PropColor;
14
- variant?: 'solid' | 'outline' | 'soft' | 'subtle';
15
- actions?: ButtonProps[];
16
- close?: boolean | ButtonProps;
17
- href?: string;
18
- target?: string;
19
- ui?: {
20
- base?: ClassNameValue;
21
- icon?: ClassNameValue;
22
- description?: ClassNameValue;
23
- title?: ClassNameValue;
24
- };
25
- onclose?: () => void | Promise<void>;
26
- };
27
- </script>
28
-
29
- <script lang="ts">
30
- let {
31
- title,
32
- close,
33
- icon,
34
- href,
35
- target,
36
- actions = [],
37
- color = 'primary',
38
- variant = 'solid',
39
- ui = {},
40
- onclose = () => {}
41
- }: BannerProps = $props();
42
- const id = useId();
43
-
44
- const close_props = $derived.by(() => {
45
- return defu(typeof close === 'boolean' ? {} : close, {
46
- icon: 'i-lucide-x',
47
- variant: 'link',
48
- color: variant === 'solid' ? 'secondary' : color,
49
- ui: {
50
- icon: variant === 'solid' ? 'text-white' : ''
51
- }
52
- } as ButtonProps);
53
- });
54
- const classes = $derived.by(() =>
55
- tv({
56
- slots: {
57
- base: 'flex items-center gap-2 font-sans p-4',
58
- icon: 'pi size-6',
59
- actions: '',
60
- title: ''
61
- },
62
- variants: {
63
- color: {
64
- primary: '',
65
- secondary: '',
66
- info: '',
67
- success: '',
68
- warning: '',
69
- error: ''
70
- },
71
- variant: {
72
- solid: {
73
- base: 'text-white',
74
- description: 'text-white/90'
75
- },
76
- outline: 'border',
77
- soft: '',
78
- subtle: 'border'
79
- }
80
- },
81
- compoundVariants: [
82
- {
83
- variant: 'solid',
84
- color: 'primary',
85
- class: 'bg-primary-500'
86
- },
87
- {
88
- variant: 'solid',
89
- color: 'secondary',
90
- class: 'bg-secondary-900'
91
- },
92
- {
93
- variant: 'solid',
94
- color: 'info',
95
- class: 'bg-info-500'
96
- },
97
- {
98
- variant: 'solid',
99
- color: 'success',
100
- class: 'bg-success-500'
101
- },
102
- {
103
- variant: 'solid',
104
- color: 'warning',
105
- class: 'bg-warning-500'
106
- },
107
- {
108
- variant: 'solid',
109
- color: 'error',
110
- class: 'bg-error-500'
111
- },
112
-
113
- {
114
- variant: 'outline',
115
- color: 'primary',
116
- class: 'border-primary-300 text-primary-500'
117
- },
118
- {
119
- variant: 'outline',
120
- color: 'secondary',
121
- class: 'border-secondary-300 text-secondary-900'
122
- },
123
- {
124
- variant: 'outline',
125
- color: 'info',
126
- class: 'border-info-300 text-info-500'
127
- },
128
- {
129
- variant: 'outline',
130
- color: 'success',
131
- class: 'border-success-300 text-success-500'
132
- },
133
- {
134
- variant: 'outline',
135
- color: 'warning',
136
- class: 'border-warning-300 text-warning-500'
137
- },
138
- {
139
- variant: 'outline',
140
- color: 'error',
141
- class: 'border-error-300 text-error-500'
142
- },
143
-
144
- {
145
- variant: 'soft',
146
- color: 'primary',
147
- class: 'bg-primary-100 text-primary-500'
148
- },
149
- {
150
- variant: 'soft',
151
- color: 'secondary',
152
- class: 'bg-secondary-50 text-secondary-900'
153
- },
154
- {
155
- variant: 'soft',
156
- color: 'info',
157
- class: 'bg-info-50 text-info-500'
158
- },
159
- {
160
- variant: 'soft',
161
- color: 'success',
162
- class: 'bg-success-50 text-success-500'
163
- },
164
- {
165
- variant: 'soft',
166
- color: 'warning',
167
- class: 'bg-warning-50 text-warning-500'
168
- },
169
- {
170
- variant: 'soft',
171
- color: 'error',
172
- class: 'bg-error-50 text-error-500'
173
- },
174
-
175
- {
176
- variant: 'subtle',
177
- color: 'primary',
178
- class: 'bg-primary-100 text-primary-500 border-primary-300'
179
- },
180
- {
181
- variant: 'subtle',
182
- color: 'secondary',
183
- class: 'bg-secondary-50 text-secondary-900 border-secondary-300'
184
- },
185
- {
186
- variant: 'subtle',
187
- color: 'info',
188
- class: 'bg-info-50 text-info-500 border-info-300'
189
- },
190
- {
191
- variant: 'subtle',
192
- color: 'success',
193
- class: 'bg-success-50 text-success-500 border-success-300'
194
- },
195
- {
196
- variant: 'subtle',
197
- color: 'warning',
198
- class: 'bg-warning-50 text-warning-500 border-warning-300'
199
- },
200
- {
201
- variant: 'subtle',
202
- color: 'error',
203
- class: 'bg-error-50 text-error-500 border-error-300'
204
- }
205
- ]
206
- })({ color, variant })
207
- );
208
- </script>
209
-
210
- <svelte:element
211
- this={href ? 'a' : 'button'}
212
- {href}
213
- {target}
214
- class={classes.base({ class: [ui.base] })}
215
- >
216
- <div class="flex flex-grow gap-2 text-sm items-center">
217
- {#if icon}
218
- <div class="size-6">
219
- {#if typeof icon === 'string'}
220
- <div class={classes.icon({ class: [icon] })}></div>
221
- {:else if isSnippet(icon)}
222
- {@render icon()}
223
- {:else}
224
- {@const Icon = icon}
225
- <Icon />
226
- {/if}
227
- </div>
228
- {/if}
229
-
230
- <div class={classes.title({ class: [ui.title] })}>
231
- {#if isSnippet(title)}
232
- {@render title()}
233
- {:else}
234
- {title}
235
- {/if}
236
- </div>
237
-
238
- {#if actions.length > 0}
239
- {#each actions as action (action.label)}
240
- <Button
241
- {...defu(action, {
242
- size: 'xs',
243
- color: 'secondary'
244
- } as ButtonProps)}
245
- />
246
- {/each}
247
- {/if}
248
- </div>
249
-
250
- {#if close}
251
- <div>
252
- <Button {...close_props} onclick={onclose} />
253
- </div>
254
- {/if}
255
- </svelte:element>
@@ -1,24 +0,0 @@
1
- import { type PropColor } from '../index.js';
2
- import type { Component, Snippet } from 'svelte';
3
- import { type ButtonProps } from './button.svelte';
4
- import type { ClassNameValue } from 'tailwind-merge';
5
- export type BannerProps = {
6
- title: string | Snippet;
7
- icon?: string | Snippet | Component;
8
- color?: PropColor;
9
- variant?: 'solid' | 'outline' | 'soft' | 'subtle';
10
- actions?: ButtonProps[];
11
- close?: boolean | ButtonProps;
12
- href?: string;
13
- target?: string;
14
- ui?: {
15
- base?: ClassNameValue;
16
- icon?: ClassNameValue;
17
- description?: ClassNameValue;
18
- title?: ClassNameValue;
19
- };
20
- onclose?: () => void | Promise<void>;
21
- };
22
- declare const Banner: Component<BannerProps, {}, "">;
23
- type Banner = ReturnType<typeof Banner>;
24
- export default Banner;