@webamoki/web-svelte 0.5.31 → 0.5.32
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.
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
{#if label || description}
|
|
43
43
|
<div>
|
|
44
44
|
{#if label}
|
|
45
|
-
<Label class="text-sm font-medium">
|
|
45
|
+
<Label class="mb-2 text-sm font-medium">
|
|
46
46
|
{label}
|
|
47
47
|
{#if props['aria-required'] === 'true'}
|
|
48
48
|
<span class="text-red-500">*</span>
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
</Label>
|
|
51
51
|
{/if}
|
|
52
52
|
{#if description}
|
|
53
|
-
<Description class="text-sm font-medium">{description}</Description>
|
|
53
|
+
<Description class="mb-2 text-sm font-medium">{description}</Description>
|
|
54
54
|
{/if}
|
|
55
55
|
</div>
|
|
56
56
|
{/if}
|
|
@@ -16,33 +16,26 @@
|
|
|
16
16
|
class: className,
|
|
17
17
|
...restProps
|
|
18
18
|
}: Props = $props();
|
|
19
|
+
|
|
20
|
+
const inputClasses = cn(
|
|
21
|
+
'w-full rounded-lg border border-gray-300 px-4 py-3 transition-all outline-none',
|
|
22
|
+
'focus:border-transparent focus:ring-2 focus:ring-primary',
|
|
23
|
+
'disabled:cursor-not-allowed disabled:opacity-50',
|
|
24
|
+
'aria-invalid:border-red-500 aria-invalid:focus:ring-red-300',
|
|
25
|
+
className
|
|
26
|
+
);
|
|
19
27
|
</script>
|
|
20
28
|
|
|
21
29
|
{#if type === 'file'}
|
|
22
30
|
<input
|
|
23
31
|
bind:this={ref}
|
|
24
32
|
data-slot="input"
|
|
25
|
-
class={
|
|
26
|
-
'w-full rounded-lg border border-gray-300 px-4 py-3 transition-all outline-none focus:border-transparent focus:ring-2 focus:ring-primary disabled:cursor-not-allowed disabled:opacity-50',
|
|
27
|
-
'aria-invalid:border-red-500',
|
|
28
|
-
className
|
|
29
|
-
)}
|
|
33
|
+
class={inputClasses}
|
|
30
34
|
type="file"
|
|
31
35
|
bind:files
|
|
32
36
|
bind:value
|
|
33
37
|
{...restProps}
|
|
34
38
|
/>
|
|
35
39
|
{:else}
|
|
36
|
-
<input
|
|
37
|
-
bind:this={ref}
|
|
38
|
-
data-slot="input"
|
|
39
|
-
class={cn(
|
|
40
|
-
'w-full rounded-lg border border-gray-300 px-4 py-3 transition-all outline-none focus:border-transparent focus:ring-2 focus:ring-primary disabled:cursor-not-allowed disabled:opacity-50',
|
|
41
|
-
'aria-invalid:border-red-500',
|
|
42
|
-
className
|
|
43
|
-
)}
|
|
44
|
-
{type}
|
|
45
|
-
bind:value
|
|
46
|
-
{...restProps}
|
|
47
|
-
/>
|
|
40
|
+
<input bind:this={ref} data-slot="input" class={inputClasses} {type} bind:value {...restProps} />
|
|
48
41
|
{/if}
|
|
@@ -19,7 +19,11 @@
|
|
|
19
19
|
data-slot="select-trigger"
|
|
20
20
|
data-size={size}
|
|
21
21
|
class={cn(
|
|
22
|
-
|
|
22
|
+
'flex w-full items-center justify-between gap-2 rounded-lg border border-gray-300 px-4 py-3 transition-all outline-none select-none',
|
|
23
|
+
'focus:border-transparent focus:ring-2 focus:ring-primary',
|
|
24
|
+
'disabled:opacity-50',
|
|
25
|
+
'aria-invalid:border-red-500 aria-invalid:focus:ring-red-300',
|
|
26
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
23
27
|
className
|
|
24
28
|
)}
|
|
25
29
|
{...restProps}
|