@reshape-biotech/design-system 0.0.40 → 0.0.41
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,6 +19,12 @@
|
|
|
19
19
|
<Story name="Base">
|
|
20
20
|
<Input bind:value autofocus />
|
|
21
21
|
</Story>
|
|
22
|
+
<Story name="XSmall">
|
|
23
|
+
<Input bind:value autofocus size="xs" />
|
|
24
|
+
</Story>
|
|
25
|
+
<Story name="Small">
|
|
26
|
+
<Input bind:value autofocus size="sm" />
|
|
27
|
+
</Story>
|
|
22
28
|
|
|
23
29
|
<Story name="Login">
|
|
24
30
|
<div class="flex flex-col gap-2">
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
error?: Snippet;
|
|
18
18
|
input?: HTMLInputElement | HTMLTextAreaElement;
|
|
19
19
|
maxlength?: number | null;
|
|
20
|
+
size?: 'xs' | 'sm' | 'md';
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
let {
|
|
@@ -36,7 +37,8 @@
|
|
|
36
37
|
suffix,
|
|
37
38
|
error,
|
|
38
39
|
input = $bindable(),
|
|
39
|
-
maxlength = null
|
|
40
|
+
maxlength = null,
|
|
41
|
+
size = 'md'
|
|
40
42
|
}: Props = $props();
|
|
41
43
|
|
|
42
44
|
let valid = $state(true);
|
|
@@ -67,7 +69,7 @@
|
|
|
67
69
|
<label for={id ?? inputId} class="block px-1 py-2 text-sm text-secondary">{label}</label>
|
|
68
70
|
{/if}
|
|
69
71
|
<div
|
|
70
|
-
class="flex w-full items-center gap-1 rounded-lg border border-input bg-surface
|
|
72
|
+
class="flex w-full items-center gap-1 rounded-lg border border-input bg-surface shadow-input size-{size}"
|
|
71
73
|
class:!border-error={!valid}
|
|
72
74
|
>
|
|
73
75
|
{#if type === 'textarea'}
|
|
@@ -144,4 +146,37 @@
|
|
|
144
146
|
|
|
145
147
|
border-color: rgb(87 80 238 / var(--tw-border-opacity, 1))
|
|
146
148
|
}
|
|
149
|
+
|
|
150
|
+
.size-xs {
|
|
151
|
+
|
|
152
|
+
padding: 0.5rem;
|
|
153
|
+
|
|
154
|
+
font-size: 0.75rem;
|
|
155
|
+
|
|
156
|
+
line-height: 1rem
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.size-sm {
|
|
160
|
+
|
|
161
|
+
padding-left: 0.75rem;
|
|
162
|
+
|
|
163
|
+
padding-right: 0.75rem;
|
|
164
|
+
|
|
165
|
+
padding-top: 0.5rem;
|
|
166
|
+
|
|
167
|
+
padding-bottom: 0.5rem;
|
|
168
|
+
|
|
169
|
+
font-size: 0.875rem;
|
|
170
|
+
|
|
171
|
+
line-height: 1.25rem
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.size-md {
|
|
175
|
+
|
|
176
|
+
padding: 0.75rem;
|
|
177
|
+
|
|
178
|
+
font-size: 1rem;
|
|
179
|
+
|
|
180
|
+
line-height: 1.5rem
|
|
181
|
+
}
|
|
147
182
|
</style>
|
|
@@ -15,6 +15,7 @@ declare const Input: import("svelte").Component<{
|
|
|
15
15
|
error?: Snippet;
|
|
16
16
|
input?: HTMLInputElement | HTMLTextAreaElement;
|
|
17
17
|
maxlength?: number | null;
|
|
18
|
+
size?: "xs" | "sm" | "md";
|
|
18
19
|
}, {}, "input" | "value">;
|
|
19
20
|
type Input = ReturnType<typeof Input>;
|
|
20
21
|
export default Input;
|