tangled
alpha
login
or
join now
slipnote.app
/
slipnote
3
fork
atom
Built for people who think better out loud.
3
fork
atom
overview
issues
pulls
pipelines
input: Add component
isaaccorbrey.com
4 weeks ago
b01a9b8e
39a85ff8
verified
This commit was signed with the committer's
known signature
.
isaaccorbrey.com
SSH Key Fingerprint:
SHA256:mwogCTZEXIXrYk4l7PaavTNPxe1Xqjf5jMIBe0LvAHU=
+38
2 changed files
expand all
collapse all
unified
split
src
components
Input.stories.svelte
Input.svelte
+20
src/components/Input.stories.svelte
···
1
1
+
<script module>
2
2
+
import { defineMeta } from "@storybook/addon-svelte-csf";
3
3
+
import Input from "./Input.svelte";
4
4
+
5
5
+
const { Story } = defineMeta({
6
6
+
title: "Components/Input",
7
7
+
component: Input,
8
8
+
argTypes: {
9
9
+
type: { control: "select", options: ["text", "email", "password", "search"] },
10
10
+
placeholder: { control: "text" },
11
11
+
disabled: { control: "boolean" },
12
12
+
value: { control: "text" },
13
13
+
},
14
14
+
});
15
15
+
</script>
16
16
+
17
17
+
<Story
18
18
+
name="Input"
19
19
+
args={{ type: "text", placeholder: "Type something...", disabled: false, value: "" }}
20
20
+
/>
+18
src/components/Input.svelte
···
1
1
+
<script lang="ts">
2
2
+
import type { HTMLInputAttributes } from "svelte/elements";
3
3
+
let { class: className = "", ...props }: HTMLInputAttributes = $props();
4
4
+
</script>
5
5
+
6
6
+
<input
7
7
+
{...props}
8
8
+
class="
9
9
+
px-3 py-px font-base bg-slate-950/7
10
10
+
border-s-slate-950 rounded-md
11
11
+
border-l-4 border-t-4 border-r border-b
12
12
+
shadow-[inset_-1px_-1px_3px_rgba(15,23,42,0.85)]
13
13
+
focus-visible:outline-none focus-visible:border-blue-700
14
14
+
focus-visible:shadow-[inset_-1px_-1px_3px_rgb(15,23,42)]
15
15
+
transition-all motion-reduce:transition-none duration-60
16
16
+
{className}
17
17
+
"
18
18
+
/>