@r2digisolutions/ui 0.19.1 → 0.20.1
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/dist/components/index.d.ts +3 -1
- package/dist/components/index.js +3 -1
- package/dist/components/ui/NoContent/NoContent.svelte +26 -0
- package/dist/components/ui/NoContent/NoContent.svelte.d.ts +4 -0
- package/dist/components/ui/NoContent/type.d.ts +9 -0
- package/dist/components/ui/NoContent/type.js +1 -0
- package/dist/components/ui/Tag/Tag.svelte +62 -0
- package/dist/components/ui/Tag/Tag.svelte.d.ts +4 -0
- package/dist/components/ui/Tag/type.d.ts +12 -0
- package/dist/components/ui/Tag/type.js +1 -0
- package/package.json +7 -7
|
@@ -19,4 +19,6 @@ import InputRadio from './ui/InputRadio/InputRadio.svelte';
|
|
|
19
19
|
import Textarea from './ui/Textarea/Textarea.svelte';
|
|
20
20
|
import Checkbox from './ui/Checkbox/Checkbox.svelte';
|
|
21
21
|
import Badge from './ui/Badge/Badge.svelte';
|
|
22
|
-
|
|
22
|
+
import NoContent from './ui/NoContent/NoContent.svelte';
|
|
23
|
+
import Tag from './ui/Tag/Tag.svelte';
|
|
24
|
+
export { Tag, NoContent, Alert, Avatar, Button, Badge, Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter, Container, Checkbox, Field, Section, Loading, TableList, Heading, Label, Input, InputRadio, Textarea, };
|
package/dist/components/index.js
CHANGED
|
@@ -19,4 +19,6 @@ import InputRadio from './ui/InputRadio/InputRadio.svelte';
|
|
|
19
19
|
import Textarea from './ui/Textarea/Textarea.svelte';
|
|
20
20
|
import Checkbox from './ui/Checkbox/Checkbox.svelte';
|
|
21
21
|
import Badge from './ui/Badge/Badge.svelte';
|
|
22
|
-
|
|
22
|
+
import NoContent from './ui/NoContent/NoContent.svelte';
|
|
23
|
+
import Tag from './ui/Tag/Tag.svelte';
|
|
24
|
+
export { Tag, NoContent, Alert, Avatar, Button, Badge, Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter, Container, Checkbox, Field, Section, Loading, TableList, Heading, Label, Input, InputRadio, Textarea, };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Props } from './type.js';
|
|
3
|
+
|
|
4
|
+
const { title, subtitle, children, icon: Icon, ...props }: Props = $props();
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<div class={['w-full py-20 text-center', props.class]}>
|
|
8
|
+
{#if Icon}
|
|
9
|
+
<div
|
|
10
|
+
class={[
|
|
11
|
+
'mx-auto mb-6 flex h-24 w-24 items-center justify-center rounded-full bg-gradient-to-br from-blue-100 to-purple-100'
|
|
12
|
+
]}
|
|
13
|
+
>
|
|
14
|
+
<Icon class="h-12 w-12 text-gray-400" />
|
|
15
|
+
</div>
|
|
16
|
+
{/if}
|
|
17
|
+
<h3 class="text-2xl font-bold text-gray-900">{title}</h3>
|
|
18
|
+
<p class="text-md mx-auto max-w-md text-gray-500">
|
|
19
|
+
{subtitle}
|
|
20
|
+
</p>
|
|
21
|
+
{#if children}
|
|
22
|
+
<div class="mt-4 flex items-center justify-center gap-4">
|
|
23
|
+
{@render children?.()}
|
|
24
|
+
</div>
|
|
25
|
+
{/if}
|
|
26
|
+
</div>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Snippet, SvelteComponent } from 'svelte';
|
|
2
|
+
import type { ClassValue } from 'svelte/elements';
|
|
3
|
+
export interface Props {
|
|
4
|
+
icon?: typeof SvelteComponent | Snippet | any;
|
|
5
|
+
class?: ClassValue;
|
|
6
|
+
title: string;
|
|
7
|
+
subtitle: string;
|
|
8
|
+
children?: Snippet;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Props } from './type.js';
|
|
3
|
+
import { X } from 'lucide-svelte';
|
|
4
|
+
const {
|
|
5
|
+
children,
|
|
6
|
+
onclose,
|
|
7
|
+
color = 'primary',
|
|
8
|
+
variant = 'solid',
|
|
9
|
+
shadow = 'sm',
|
|
10
|
+
onclick,
|
|
11
|
+
href,
|
|
12
|
+
...props
|
|
13
|
+
}: Props = $props();
|
|
14
|
+
|
|
15
|
+
const shadows: Record<typeof shadow, string> = {
|
|
16
|
+
none: '',
|
|
17
|
+
sm: 'shadow-sm',
|
|
18
|
+
md: 'shadow-md',
|
|
19
|
+
lg: 'shadow-lg',
|
|
20
|
+
xl: 'shadow-xl'
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const type = $derived(variant === 'outline' ? 'border' : 'bg');
|
|
24
|
+
|
|
25
|
+
const colors: Record<typeof color, string> = $derived({
|
|
26
|
+
primary: `${type}-primary text-gray-100`,
|
|
27
|
+
teal: `${type}-teal-200 text-teal-800`,
|
|
28
|
+
secondary: `${type}-gray-800 text-white`,
|
|
29
|
+
danger: `${type}-red-500 text-white`,
|
|
30
|
+
white: `${type}-white text-black`,
|
|
31
|
+
info: `${type}-blue-500 text-whit`,
|
|
32
|
+
outline: `${type}-gray-200 text-gray-800`,
|
|
33
|
+
default: `${type}-gray-800 text-white`
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const variants: Record<typeof variant, string> = $derived({
|
|
37
|
+
solid: colors[color],
|
|
38
|
+
outline: 'border border-gray-200'
|
|
39
|
+
});
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<a
|
|
43
|
+
href={onclick ? href : undefined}
|
|
44
|
+
tabindex="0"
|
|
45
|
+
class={[
|
|
46
|
+
'inline-flex w-fit items-center gap-x-1 rounded-full px-2.5 py-0.5 text-xs font-medium',
|
|
47
|
+
props.class,
|
|
48
|
+
shadows[shadow],
|
|
49
|
+
variants[variant]
|
|
50
|
+
]}
|
|
51
|
+
{onclick}
|
|
52
|
+
>
|
|
53
|
+
{@render children()}
|
|
54
|
+
{#if onclose}
|
|
55
|
+
<button
|
|
56
|
+
class="bg-opacity-75 hover:bg-opacity-100 flex h-4 w-4 cursor-pointer items-center justify-center rounded-full bg-teal-200 text-teal-500 hover:bg-teal-200 dark:bg-teal-500/10 dark:text-teal-500"
|
|
57
|
+
onclick={onclose}
|
|
58
|
+
>
|
|
59
|
+
<X class="h-3 w-3" />
|
|
60
|
+
</button>
|
|
61
|
+
{/if}
|
|
62
|
+
</a>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { ClassValue } from 'svelte/elements';
|
|
3
|
+
export interface Props {
|
|
4
|
+
onclick?(): void;
|
|
5
|
+
href?: string;
|
|
6
|
+
variant?: 'solid' | 'outline';
|
|
7
|
+
color?: 'primary' | 'secondary' | 'danger' | 'white' | 'teal' | 'info' | 'outline' | 'default';
|
|
8
|
+
shadow?: 'none' | 'sm' | 'md' | 'lg' | 'xl';
|
|
9
|
+
onclose?(): void;
|
|
10
|
+
class?: ClassValue;
|
|
11
|
+
children: Snippet;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@r2digisolutions/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"packageManager": "bun@1.2.19",
|
|
6
6
|
"publishConfig": {
|
|
@@ -55,11 +55,11 @@
|
|
|
55
55
|
"@storybook/addon-interactions": "^8.6.14",
|
|
56
56
|
"@storybook/addon-svelte-csf": "5.0.7",
|
|
57
57
|
"@storybook/blocks": "^8.6.14",
|
|
58
|
-
"@storybook/svelte": "^9.0.
|
|
59
|
-
"@storybook/sveltekit": "^9.0.
|
|
58
|
+
"@storybook/svelte": "^9.0.18",
|
|
59
|
+
"@storybook/sveltekit": "^9.0.18",
|
|
60
60
|
"@storybook/test": "^8.6.14",
|
|
61
61
|
"@sveltejs/adapter-static": "^3.0.8",
|
|
62
|
-
"@sveltejs/kit": "^2.25.
|
|
62
|
+
"@sveltejs/kit": "^2.25.2",
|
|
63
63
|
"@sveltejs/package": "^2.4.0",
|
|
64
64
|
"@sveltejs/vite-plugin-svelte": "^6.1.0",
|
|
65
65
|
"@tailwindcss/postcss": "^4.1.11",
|
|
@@ -76,13 +76,13 @@
|
|
|
76
76
|
"prettier-plugin-svelte": "^3.4.0",
|
|
77
77
|
"prettier-plugin-tailwindcss": "^0.6.14",
|
|
78
78
|
"publint": "^0.3.12",
|
|
79
|
-
"storybook": "^9.0.
|
|
80
|
-
"svelte": "^5.36.
|
|
79
|
+
"storybook": "^9.0.18",
|
|
80
|
+
"svelte": "^5.36.16",
|
|
81
81
|
"svelte-check": "^4.3.0",
|
|
82
82
|
"tailwindcss": "^4.1.11",
|
|
83
83
|
"typescript": "^5.8.3",
|
|
84
84
|
"typescript-eslint": "^8.38.0",
|
|
85
|
-
"vite": "^7.0.
|
|
85
|
+
"vite": "^7.0.6",
|
|
86
86
|
"vitest": "^3.2.4"
|
|
87
87
|
},
|
|
88
88
|
"dependencies": {
|