@r2digisolutions/ui 0.15.1 → 0.16.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.
@@ -15,4 +15,5 @@ import Heading from './ui/Heading/Heading.svelte';
15
15
  import Label from './ui/Label/Label.svelte';
16
16
  import Field from './ui/Field/Field.svelte';
17
17
  import Input from './ui/Input/Input.svelte';
18
- export { Alert, Avatar, Button, Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter, Container, Field, Section, Loading, TableList, Heading, Label, Input };
18
+ import InputRadio from './ui/InputRadio/InputRadio.svelte';
19
+ export { Alert, Avatar, Button, Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter, Container, Field, Section, Loading, TableList, Heading, Label, Input, InputRadio, };
@@ -15,4 +15,5 @@ import Heading from './ui/Heading/Heading.svelte';
15
15
  import Label from './ui/Label/Label.svelte';
16
16
  import Field from './ui/Field/Field.svelte';
17
17
  import Input from './ui/Input/Input.svelte';
18
- export { Alert, Avatar, Button, Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter, Container, Field, Section, Loading, TableList, Heading, Label, Input };
18
+ import InputRadio from './ui/InputRadio/InputRadio.svelte';
19
+ export { Alert, Avatar, Button, Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter, Container, Field, Section, Loading, TableList, Heading, Label, Input, InputRadio, };
@@ -6,6 +6,7 @@
6
6
 
7
7
  <input
8
8
  {...props}
9
+ {type}
9
10
  onchange={(e) => {
10
11
  const value = e.currentTarget.value;
11
12
 
@@ -25,5 +26,8 @@
25
26
  (onchange as (value: string | null, e: Event) => void)?.(value || null, e);
26
27
  }
27
28
  }}
28
- class="block w-full rounded-lg border border-gray-300 py-3 pr-3 pl-10 transition-colors focus:border-transparent focus:ring-2 focus:ring-purple-500"
29
+ class={[
30
+ 'block w-full rounded-lg border border-gray-300 py-3 pr-3 pl-10 transition-colors focus:border-transparent focus:ring-2 focus:ring-purple-500',
31
+ props.class
32
+ ]}
29
33
  />
@@ -0,0 +1,25 @@
1
+ <script lang="ts">
2
+ import type { Props } from './type.js';
3
+ import { Circle } from 'lucide-svelte';
4
+
5
+ let { children, name, group = $bindable(), value, ...props }: Props = $props();
6
+ </script>
7
+
8
+ <input aria-hidden="true" {name} tabindex="-1" type="radio" {value} bind:group class="hidden" />
9
+
10
+ <div class="flex items-center gap-2">
11
+ <span
12
+ role="radio"
13
+ aria-checked="true"
14
+ class="border-primary text-primary ring-offset-background focus-visible:ring-ring mr-1 flex aspect-square h-4 w-4 items-center justify-center rounded-full border focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50"
15
+ aria-describedby="«rl»-form-item-description"
16
+ tabindex="-1"
17
+ >
18
+ <span class="flex items-center justify-center">
19
+ {#if group === value}
20
+ <Circle class={`bg-primary h-2 w-2 rounded-full transition`} />
21
+ {/if}
22
+ </span>
23
+ </span>
24
+ {@render children()}
25
+ </div>
@@ -0,0 +1,4 @@
1
+ import type { Props } from './type.js';
2
+ declare const InputRadio: import("svelte").Component<Props, {}, "group">;
3
+ type InputRadio = ReturnType<typeof InputRadio>;
4
+ export default InputRadio;
@@ -0,0 +1,9 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { ClassValue } from 'svelte/elements';
3
+ export interface Props {
4
+ name?: string;
5
+ children: Snippet;
6
+ class?: ClassValue;
7
+ group?: string;
8
+ value: string;
9
+ }
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@r2digisolutions/ui",
3
- "version": "0.15.1",
3
+ "version": "0.16.0",
4
4
  "private": false,
5
5
  "packageManager": "bun@1.2.19",
6
6
  "publishConfig": {
@@ -77,7 +77,7 @@
77
77
  "prettier-plugin-tailwindcss": "^0.6.14",
78
78
  "publint": "^0.3.12",
79
79
  "storybook": "^9.0.17",
80
- "svelte": "^5.36.8",
80
+ "svelte": "^5.36.10",
81
81
  "svelte-check": "^4.3.0",
82
82
  "tailwindcss": "^4.1.11",
83
83
  "typescript": "^5.8.3",