@r2digisolutions/ui 0.19.0 → 0.20.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.
@@ -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
- export { Alert, Avatar, Button, Badge, Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter, Container, Checkbox, Field, Section, Loading, TableList, Heading, Label, Input, InputRadio, Textarea, };
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, };
@@ -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
- export { Alert, Avatar, Button, Badge, Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter, Container, Checkbox, Field, Section, Loading, TableList, Heading, Label, Input, InputRadio, Textarea, };
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,4 @@
1
+ import type { Props } from './type.js';
2
+ declare const NoContent: import("svelte").Component<Props, {}, "">;
3
+ type NoContent = ReturnType<typeof NoContent>;
4
+ export default NoContent;
@@ -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,4 @@
1
+ import type { Props } from './type.js';
2
+ declare const Tag: import("svelte").Component<Props, {}, "">;
3
+ type Tag = ReturnType<typeof Tag>;
4
+ export default Tag;
@@ -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 {};
@@ -1,6 +1,9 @@
1
1
  import type { ClassValue } from "svelte/elements";
2
2
  export interface Props {
3
3
  onchange?: (value: string | null, e: Event) => void;
4
+ oninput?: (e: Event & {
5
+ currentTarget: HTMLTextAreaElement;
6
+ }) => void;
4
7
  class?: ClassValue;
5
8
  rows?: number;
6
9
  cols?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@r2digisolutions/ui",
3
- "version": "0.19.0",
3
+ "version": "0.20.0",
4
4
  "private": false,
5
5
  "packageManager": "bun@1.2.19",
6
6
  "publishConfig": {